We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Proxy::headers
1 parent f089df8 commit fa19862Copy full SHA for fa19862
src/proxy.rs
@@ -365,8 +365,21 @@ impl Proxy {
365
self
366
}
367
368
- /// Adds a Custom Headers to Proxy
+ /// Adds custom headers to this Proxy
369
///
370
+ /// # Example
371
+ /// ```
372
+ /// # extern crate reqwest;
373
+ /// # use reqwest::header::*;
374
+ /// # fn run() -> Result<(), Box<dyn std::error::Error>> {
375
+ /// let mut headers = HeaderMap::new();
376
+ /// headers.insert(USER_AGENT, "reqwest".parse().unwrap();
377
+ /// let proxy = reqwest::Proxy::https("http://localhost:1234")?
378
+ /// .headers(headers);
379
+ /// # Ok(())
380
+ /// # }
381
+ /// # fn main() {}
382
383
pub fn headers(mut self, headers: HeaderMap) -> Proxy {
384
self.intercept.set_custom_headers(headers);
385
0 commit comments