cleanup and fixed query
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use reqwest::{header, Client, Proxy};
|
||||
use reqwest::{Client, Proxy};
|
||||
use serde_json::json;
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug)]
|
||||
@@ -38,23 +38,22 @@ pub struct FlareSolverrSolution {
|
||||
cookies: Vec<FlaresolverrCookie>,
|
||||
userAgent: String,
|
||||
}
|
||||
impl FlareSolverrSolution {
|
||||
fn to_client(&self,){
|
||||
let mut headers = header::HeaderMap::new();
|
||||
for (h, v) in &self.headers {
|
||||
println!("{}: {}", h, v);
|
||||
headers.insert(
|
||||
header::HeaderName::from_bytes(h.as_bytes()).unwrap(),
|
||||
header::HeaderValue::from_str(v).unwrap(),
|
||||
);
|
||||
}
|
||||
|
||||
// let client = reqwest::Client::builder()
|
||||
// .danger_accept_invalid_certs(true)
|
||||
// .
|
||||
// .build().unwrap();
|
||||
}
|
||||
}
|
||||
// impl FlareSolverrSolution {
|
||||
// fn to_client(&self,){
|
||||
// let mut headers = header::HeaderMap::new();
|
||||
// for (h, v) in &self.headers {
|
||||
// println!("{}: {}", h, v);
|
||||
// headers.insert(
|
||||
// header::HeaderName::from_bytes(h.as_bytes()).unwrap(),
|
||||
// header::HeaderValue::from_str(v).unwrap(),
|
||||
// );
|
||||
// }
|
||||
// // let client = reqwest::Client::builder()
|
||||
// // .danger_accept_invalid_certs(true)
|
||||
// // .
|
||||
// // .build().unwrap();
|
||||
// }
|
||||
// }
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug)]
|
||||
pub struct FlareSolverrResponse {
|
||||
status: String,
|
||||
@@ -85,7 +84,7 @@ impl Flaresolverr {
|
||||
.build()?;
|
||||
|
||||
let response = client
|
||||
.post("http://192.168.0.103:8191/v1")
|
||||
.post(&self.url)
|
||||
.header("Content-Type", "application/json")
|
||||
.json(&json!({
|
||||
"cmd": request.cmd,
|
||||
|
||||
Reference in New Issue
Block a user