Commit Graph

50 Commits

Author SHA1 Message Date
Patrick Lühne
6705b90a15 Fix typo in documentation (#1056)
This fixes a typo with multiple occurrences in the documentation and
rewraps the documentation comments at 80 characters.
2020-10-12 18:04:33 -07:00
Zac Pullar-Strecker
db24d54097 Add must_use to ClientBuilder & RequestBuilder (#1011) 2020-08-21 08:58:53 -07:00
Jason van den Hurk
83fa93ccaf Make headers method on WASM client for compatibility with async_impl (#991)
The replace_headers method had to be moved since the async_impl module
is not compiled while compiling to wasm. This caused the replace_headers
method to be unavailable. fast_random had to be excluded from the wasm
build to prevent dead code warnings in the wasm target.
2020-08-06 15:07:43 -07:00
Takayuki Maeda
1e6957a4ac Fix clippy warnings (#981)
* refactor: fix clippy warnings

* refactor: fix redundant_closure

* refactor: fix collapsible if

* refactor: remove unnecessary_unwrap
2020-07-27 09:02:47 -07:00
Damien Cuenot
d879d6f6c2 Define authorization headers as sensitive header (#916) 2020-05-22 14:39:55 -07:00
x1957
0595c04d10 impl TryFrom http::Request (#887) 2020-05-21 09:23:14 -07:00
Yuhao Fang
f267e1435d Adds From trait for http::Request 2020-03-03 11:24:12 -08:00
rhysd
6004623784 Add RequestBuilder::fetch_mode_no_cors() 2020-01-08 11:47:47 -08:00
kodieg
b159963f6c Add request timeout (#761)
Closes #754
2020-01-03 11:25:04 -08:00
Sean McArthur
be52c4d558 support url with authority (#736) 2019-12-11 13:42:45 -08:00
Sean McArthur
7631c0390e Rename 'unstable-stream' feature to 'stream' (#733) 2019-12-10 16:55:53 -08:00
Gleb Pomykalov
0f32c4a01a Update to hyper 0.13 2019-12-10 16:24:05 -08:00
Nathan West
3a24cc1d4b Reimplemented RequestBuilder::basic_auth to use Base64Encoder (#713) 2019-11-19 10:45:14 -08:00
tobdob
3a50ed11f8 Implement try_clone for async requests (#698)
Fixes #533
2019-11-04 18:14:40 -08:00
Artem Vorotnikov
cfc312f8dd Remove remnants of old typed headers (#690) 2019-10-23 12:18:06 -07:00
Constantin Nickel
24394364eb Make json an optional feature (default off) 2019-09-27 12:27:23 -07:00
Sean McArthur
6413a4349e Update tokio and hyper alphas 2019-09-25 14:19:37 -07:00
Sean McArthur
53495e1526 Redesign Error type
- The `Error`'s kind is a now a set of variants depending on the context
  of when an error could occur.
- If another error was the cause, it is now always the `source`.

Along with the `is_*` methods, this should help in understanding *when*
a certain error occurred. For example, an error setting the TLS
certificates will return a builder error, with the TLS error as the
source. This should help differentiate from a TLS error that happens
when connecting to a server.

It also makes the internal code less dependent on all the exact
dependencies that can be enabled or disabled.
2019-09-17 14:23:22 -07:00
Constantin Nickel
b1a90eb402 Prune the futures dependencies 2019-09-12 07:52:31 -07:00
Sean McArthur
87a09322d6 Make the async Client default (#626)
The previously default Client is moved to `reqwest::blocking`, while the
async client becomes the main API.

Closes #622
2019-09-09 17:20:51 -07:00
Sean McArthur
ba7b2a754e refactor all to async/await (#617)
Co-authored-by: Danny Browning <danny.browning@protectwise.com>
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2019-09-06 17:22:56 -07:00
danieleades
cf8944a0f0 cargo fmt (#604)
Run rustfmt and setup CI to check for it.
2019-08-29 09:52:39 -07:00
Daniel Eades
3ba4b6eadf port all optional features to 2018-edition 2019-08-16 12:59:55 -07:00
Daniel Eades
5dc5162765 update and tidy code 2019-08-16 12:59:55 -07:00
Daniel Eades
86d9cbc66e cargo fix --edition 2019-08-16 12:59:55 -07:00
nirasan
9f22f46e85 Clarify correct specification of dependency on serde (#525)
Closes #494
2019-05-16 10:46:00 -07:00
Ben Boeckel
1bdc3fa3c8 request: test adding duplicate headers to the request (#519) 2019-05-03 11:48:31 -07:00
Adilson Neto
f798a8b2df Remove trailing '?' on empty query. (#506)
Closes #464
2019-04-24 17:36:24 -07:00
Sean McArthur
faaf41cdfb Fix basic_auth async builder to send capital "Basic"
Closes #468
2019-03-20 14:11:40 -07:00
Frank Benkstein
08847cc9f5 add bearer auth to async RequestBuilder (#475) 2019-03-13 11:00:54 -07:00
Constantin Nickel
4fba983e5e async/client: return a impl Future on execute() 2019-02-20 17:59:12 -08:00
Luca Bruno
0c84e6b9e9 async/request: add a basic example for send() 2019-02-15 10:33:57 -08:00
Luca Bruno
8b62f47ac3 async/request: return a impl Future on send() 2019-02-15 10:33:57 -08:00
Sean McArthur
56eff821fd refactor multipart to reduce duplicate code between sync and async 2019-01-07 13:40:04 -08:00
Kevin Wilson
4c21127f15 add async multipart request handling 2019-01-07 10:57:51 -08:00
Sean McArthur
9c0c5ca42d Fix RequestBuilder::headers to include multiple values
`RequestBuilder::headers` will always overwrite any existing header with
the same name, but will now correctly append extra values from the *new*
header map.

Closes #407
2019-01-03 12:28:03 -08:00
Sean McArthur
55fcedcf97 pub(crate)ify the async::client module 2018-09-11 14:37:50 -07:00
Sean McArthur
1ded95ce0e pub(crate)ify the async::request module 2018-09-11 14:33:38 -07:00
Sean McArthur
e182c416c9 add hyper-011 cargo feature to ease migration 2018-08-15 16:47:02 -07:00
Sean McArthur
3fbda4fd49 remove unstable language and feature 2018-08-15 16:08:47 -07:00
Sean McArthur
d060891b62 fix async request builder tests 2018-08-15 15:36:05 -07:00
Sean McArthur
591b83a8b8 remove some unwraps 2018-08-15 15:22:28 -07:00
Konrad Borowski
279725ee5e Change RequestBuilder methods to own a builder
This means that `build` cannot possibly panic anymore due to being
called multiple times. This is a breaking change as it breaks the
behaviour of builder methods called without assigning to a new variable
or chaining. It's rather easy to fix those usages, as they won't
compile anymore and can be fixed by assigning a result.

Additionally, this change reduces the size of `RequestBuilder`,
although this likely isn't all that meaningful, as usually there
is no reason to store builders in structures.
2018-08-15 12:56:28 -07:00
Douman
a25f62f4cb Use base64 to fully encode basic auth creds
Change basic_auth to use less allocations
2018-07-31 13:54:44 -07:00
Yash Srivastav
c417d6dab8 Upgrade hyper to 0.12
Closes #304
2018-07-05 10:03:31 -07:00
Ben Shaw
7bd3619ece fix query doc typo (#309) 2018-06-26 18:40:28 -07:00
Oliver Schneider
f0b774960d Allow unsized types in query, form and json 2018-02-01 14:44:39 +01:00
Simon Bernier St-Pierre
5672791ad0 add query method to unstable api 2018-01-22 20:42:05 -05:00
Sean McArthur
779f8080ef change Builders to only error at the end
Closes #189
2017-08-31 18:10:45 -07:00
Sean McArthur
665b4fe718 upgrade hyper to v0.11 2017-06-21 09:47:21 -07:00