1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use reqwest::header::HeaderMap;
#[allow(dead_code)]
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HeaderInfo {
url: String,
status: i64,
headers: Headers,
}
#[allow(dead_code)]
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Headers {
#[serde(rename = "cache-control")]
cache_control: String,
#[serde(rename = "transfer-encoding")]
transfer_encoding: String,
#[serde(rename = "content-type")]
content_type: String,
date: String,
vary: String,
#[serde(rename = "request-id")]
request_id: String,
#[serde(rename = "client-request-id")]
client_request_id: String,
#[serde(rename = "x-ms-ags-diagnostic")]
x_ms_ags_diagnostic: String,
#[serde(rename = "odata-version")]
odata_version: String,
duration: String,
#[serde(rename = "strict-transport-security")]
strict_transport_security: String,
}
#[derive(Debug, Default, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct GraphHeaders {
url: String,
status: u16,
#[serde(skip)]
header_map: HeaderMap,
}
impl From<reqwest::blocking::Response> for GraphHeaders {
fn from(r: reqwest::blocking::Response) -> Self {
GraphHeaders {
url: r.url().as_str().to_string(),
status: r.status().as_u16(),
header_map: r.headers().to_owned(),
}
}
}
impl From<&reqwest::blocking::Response> for GraphHeaders {
fn from(r: &reqwest::blocking::Response) -> Self {
GraphHeaders {
url: r.url().as_str().to_string(),
status: r.status().as_u16(),
header_map: r.headers().to_owned(),
}
}
}
impl From<reqwest::Response> for GraphHeaders {
fn from(r: reqwest::Response) -> Self {
GraphHeaders {
url: r.url().as_str().to_string(),
status: r.status().as_u16(),
header_map: r.headers().to_owned(),
}
}
}
impl From<&reqwest::Response> for GraphHeaders {
fn from(r: &reqwest::Response) -> Self {
GraphHeaders {
url: r.url().as_str().to_string(),
status: r.status().as_u16(),
header_map: r.headers().to_owned(),
}
}
}