This commit updates the MultiAdapter to account for connecitons
being closed unexpectedly and then retried. When this occurs, curl
attempts to rewind the stream before sending. Because we use a
callback function to stream large payloads, curl fails to rewind
the stream and fails the transaction without associating the correct
error code. This commit checks if a transaction has a response
before processing. If a transaction doesn't have a response, then
we attempt to retry the request transparently (without emitting
another set of before events, essentially doing exactly what
curl would have done if it was possible to rewind the stream). If
the request did not have a body, then an error event is emitted as
it is a very weird error. If the request had a body but wasn't
rewindable, then an error event is emitted. If the request had a
body and a rewindable stream, then it is rewound and retried.
This change also updates the MultiAdapter and BatchContext to
transfer until the number of open handles in the BatchContext
reaches 0. This removes some complexity from the main transfer loop
that had to account for pending transactions.
Closes#710
Using the AppendStream to vastly clean up how a multipart POST is created.
This changes also cleans up how the body is sent over the wire, eliminating
some bugs I discovered when fields are sent before files.
This commit adds a QueryParser class that is able to perform much more
robust query parsing. The query parser can track whether or not to use
a duplicate aggregator and whether or not to use numeric indices in
mutli-value key value pairs. You can now control how the query string
is url-decoded when parsing as well as disable url-decoding.
This change addresses nested key value pairs using 'a[b][c]=d' syntax
such that when parsed, will produce nested arrays containing
`['a' => ['b' => ['c' => 'd']]]`. This gets Guzzle query strings more
like PHP's parse_str().
This change closes#730 and closes#731 dealing with multipart POST
requests stripping "+" signs from values. POST key value pairs for
multipart requests are no longer modified at all, but rather sent over
the wire exactly as given.
Closes#706. This commit makes it so that POST headers are not
applied until sending a request. This allows you to do things like
change the query aggregator used before sending a request.
When using multiple slashes in URLs, normalization caused them to be combined
into a single slash. This commit fixes that issue to work exactly how Chrome
handles these types of URLs. Closes#713.
The purpose here is to allow running guzzle3 and guzzle4 tests at the
same time, on the same machine. This is needed for
http://hhvm.com/frameworks/ to work correctly. Ideally we'll make these
more isolated in the future, but this should be an unobtrusive
short-term fix.
- Adding the json request option to provide better symmetry
between request and response APIs.
- Updating the quickstart guide and documentation.
- Closes#674