Commit Graph

29 Commits

Author SHA1 Message Date
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
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
polyfloyd
9cbd8c41ad Add try_clone to Request and RequestBuilder (#387)
The need to clone a request or builder may arise when repeating a
request multiple times. This can be either because:
* The Request object is consumed by Client::execute
* The request might need to be retried later
* A complex request needs to be repeated with slightly different
  parameters, such as in the Partial-Content scheme which allows seeking
  through the content of large object over HTTP by performing multiple
  HTTP GET requests.

To make this easier, it would be nice if Request and RequestBuilder
were to implement the Clone trait. However, this is not possible because
a body might be set that is a stream which can not be cloned. To get
around this, I added a try_clone function that fails if the body is not
clonable.

An alternative solution would be to add a type parameter to Request for
the body so a conditional implementation for Clone can be added.
2018-12-17 11:55:06 -08:00
KNnut
527bcecce6 fix typo about x-form-urlencoded doc 2018-11-05 11:26:11 -08:00
Sean McArthur
2698148743 fix improper handling of request body backpressure
Closes #348
2018-09-19 14:20:12 -07:00
Sean McArthur
2143aad3cd pub(crate)ify the multipart facade 2018-08-29 18:22:55 -07:00
Andrey Kutejko
f26d94d4ac use capital B for "Basic" and "Bearer" authentication helpers (#332) 2018-08-28 18:08:59 -07:00
Brendan Hansknecht
ef05bfbf97 Add bearer auth to RequestBuilder (#330) 2018-08-22 12:00:58 -07:00
Sean McArthur
e182c416c9 add hyper-011 cargo feature to ease migration 2018-08-15 16:47:02 -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
András Eisenberger
de402ceac6 Minor documentation fix 2018-02-06 20:55:08 +01:00
Oliver Schneider
f0b774960d Allow unsized types in query, form and json 2018-02-01 14:44:39 +01:00
Simon Bernier St-Pierre
f180a64551 add query string support to RequestBuilder 2018-01-09 18:48:49 -05:00
Sean McArthur
779f8080ef change Builders to only error at the end
Closes #189
2017-08-31 18:10:45 -07:00
e00E
93c8321305 Add multipart/form-data support 2017-08-21 10:58:59 -07:00
Sean McArthur
c166e04a55 fix lint warnings on newer nightly 2017-08-17 10:52:22 -07:00
Sean McArthur
fb4dd2e0b3 improve docs around Body type 2017-07-13 12:17:38 -07:00
Sean McArthur
665b4fe718 upgrade hyper to v0.11 2017-06-21 09:47:21 -07:00
James Kominick
3cbb6cd210 RequestBuilder doc improvements
- document `body`, `headers`, `basic_auth` methods
2017-06-09 16:21:01 -04:00
Michal Budzynski
e3bf6756f4 Added missing "Errors" and "Panics" sections to request.rs and response.rs 2017-06-04 04:49:33 +02:00
Sean McArthur
e176dcebca convert RequestBuilder to a &mut Self builder
Closes #108
2017-06-01 16:23:16 -07:00