Commit Graph

8 Commits

Author SHA1 Message Date
Kent Fredric
c6fbbd9181 Disable test_blocking_inside_a_runtime without cfg(debug_assertions)
As by default, when executing tests with -C opt-level=n where "n"
is greater than 0, debug assertions are disabled, which removes the
panic!() this test is expecting.

With this tweak, tests no longer fail with any choice of -C opt-level,
and additionally, tests still execute correctly if these tests are
compiled with:

  -C opt-level=3 -C debug-assertions=yes

Closes: https://github.com/seanmonstar/reqwest/issues/831
2020-03-09 11:47:57 -07:00
Sean McArthur
04980689ce Newest rustfmt changes 2020-02-06 10:17:40 -08:00
Gleb Pomykalov
0f32c4a01a Update to hyper 0.13 2019-12-10 16:24:05 -08:00
Constantin Nickel
24394364eb Make json an optional feature (default off) 2019-09-27 12:27:23 -07:00
Sean McArthur
f4100e4148 Rewrite tests with a hyper server instead of raw TCP
This makes the tests much less brittle, by not depending on the exact
order of the HTTP headers, nor always requiring to check for every
single header.
2019-09-23 14:06:01 -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
Sean McArthur
5356776834 refine async API
- Converted `Response::text` and `Response::json` to `async fn`
- Added `Response::bytes` async fn as a counterpat to `text`.
- Added `Response::chunk` async fn to stream chunks of the response body.
- Added `From<Response> for Body` to allow piping a response as a request body.
- Removed `Decoder` from public API
- Removed body accessor methods from `Response`
- Removed `Chunk` type, replaced with `bytes::Bytes`.
- Removed public `impl Stream for Body`.
2019-09-10 14:06:09 -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