Skip to content

Commit fa19862

Browse files
committed
docs: add doc for Proxy::headers
1 parent f089df8 commit fa19862

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/proxy.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,21 @@ impl Proxy {
365365
self
366366
}
367367

368-
/// Adds a Custom Headers to Proxy
368+
/// Adds custom headers to this Proxy
369369
///
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+
/// ```
370383
pub fn headers(mut self, headers: HeaderMap) -> Proxy {
371384
self.intercept.set_custom_headers(headers);
372385
self

0 commit comments

Comments
 (0)