Crates.io | reqwest-header |
lib.rs | reqwest-header |
version | 0.1.0 |
source | src |
created_at | 2023-06-27 05:28:32.300175 |
updated_at | 2023-06-27 05:28:32.300175 |
description | Header info parser for reqwest crate |
homepage | |
repository | https://gitlab.com/andrew_ryan/reqwest-header |
max_upload_size | |
id | 901006 |
size | 6,543 |
#[tokio::main]
async fn main() {
let header_data = r##"
GET /api/v1/crates?page=1&per_page=10&q={} HTTP/2
Host: crates.io
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.5249.119 Safari/537.36
Referer: https://crates.io/search?q=doe
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
"##.format(name);
let info = reqwest_header::parse_to_reqwest_header(&header_data).unwrap();
let cilent = reqwest::Client::new();
let response = cilent
.get(info.url)
.headers(info.header)
.send()
.await
.unwrap();
let test = response.text().await.unwrap().to_string();
}