Debug output

This commit is contained in:
Valentin Brandl 2019-07-28 17:40:08 +02:00
parent 0b6fe9f5e3
commit 0d1206fed2
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -17,6 +17,9 @@ impl Cloudflare {
client: &Client, client: &Client,
file: &str, file: &str,
) -> impl Future<Item = HttpResponse, Error = Error> { ) -> impl Future<Item = HttpResponse, Error = Error> {
let payload = CfPurgeRequest::singleton::<T>(file);
println!("{:#?}", payload);
eprintln!("{:#?}", payload);
client client
.post(format!( .post(format!(
"https://api.cloudflare.com/client/v4/zones/{}/purge_cache", "https://api.cloudflare.com/client/v4/zones/{}/purge_cache",
@ -26,7 +29,7 @@ impl Cloudflare {
.header("X-Auth-Email", Self::auth_email()) .header("X-Auth-Email", Self::auth_email())
.header("X-Auth-Key", Self::auth_key()) .header("X-Auth-Key", Self::auth_key())
.content_type("application/json") .content_type("application/json")
.send_json(&CfPurgeRequest::singleton::<T>(file)) .send_json(&payload)
.from_err() .from_err()
.and_then(|response| HttpResponse::build(response.status()).streaming(response)) .and_then(|response| HttpResponse::build(response.status()).streaming(response))
} }
@ -63,7 +66,7 @@ impl Cloudflare {
} }
} }
#[derive(Serialize)] #[derive(Serialize, Debug)]
struct CfPurgeRequest { struct CfPurgeRequest {
files: Vec<String>, files: Vec<String>,
} }