Update post_json
to take in a bool for allowing for redirects
This commit is contained in:
parent
7f5afeb9fa
commit
69a4fffae2
2 changed files with 9 additions and 3 deletions
|
@ -40,8 +40,14 @@ pub trait HttpClient: Send + Sync {
|
|||
&'a self,
|
||||
uri: &str,
|
||||
body: AsyncBody,
|
||||
follow_redirects: bool,
|
||||
) -> BoxFuture<'a, Result<Response<AsyncBody>, Error>> {
|
||||
let request = isahc::Request::builder()
|
||||
.redirect_policy(if follow_redirects {
|
||||
RedirectPolicy::Follow
|
||||
} else {
|
||||
RedirectPolicy::None
|
||||
})
|
||||
.method(Method::POST)
|
||||
.uri(uri)
|
||||
.header("Content-Type", "application/json")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue