mirror of https://github.com/fafhrd91/actix-web
add Client::headers
This commit is contained in:
parent
3188ef5731
commit
88defccb3e
|
@ -1,6 +1,9 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
|
### Added
|
||||||
|
* Add `Client::headers` to get default mut reference of `HeaderMap` of client object.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* `ConnectorService` type is renamed to `BoxConnectorService` [#2081]
|
* `ConnectorService` type is renamed to `BoxConnectorService` [#2081]
|
||||||
|
|
||||||
|
|
|
@ -286,4 +286,12 @@ impl Client {
|
||||||
}
|
}
|
||||||
req
|
req
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get default HeaderMap of Client.
|
||||||
|
///
|
||||||
|
/// Returns Some(&mut HeaderMap) when Client object is unique
|
||||||
|
/// (No other clone of client exists at the same time).
|
||||||
|
pub fn headers(&mut self) -> Option<&mut HeaderMap> {
|
||||||
|
Rc::get_mut(&mut self.0.headers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue