1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

958 Commits

Author SHA1 Message Date
Michael Dowling
d68dc43283 Accounting for random connection issues in multi-adapter
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
2014-07-31 21:02:29 -07:00
Michael Dowling
f74931ee9f Fixing bug in serialzing POST requests 2014-07-22 17:48:20 -07:00
Michael Dowling
5ab8c29546 Does not create a save_to stream until it is used. Closes #715 2014-07-19 12:17:17 -07:00
Michael Dowling
9a0a38096c Merge pull request #736 from jamiehannaford/url-combine-0-fix
Ensuring that '0' paths can be combined into empty URLs
2014-07-18 10:22:02 -07:00
Jamie Hannaford
0bfd7230a0 Ensuring that '0' paths can be combined into empty URLs 2014-07-16 13:30:30 +02:00
Michael Dowling
2c7cc07ba8 Merge remote-tracking branch 'pdt256/master'
Conflicts:
	src/Post/PostBody.php
2014-07-15 18:36:35 -07:00
Jamie Isaacs
4166ecbe79 Allowing PostBody to support multipart/form-data with base64 encoded strings 2014-07-15 17:20:00 -07:00
Michael Dowling
14f0873442 Lots of fixes to multipart/form-data
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.
2014-07-15 15:50:36 -07:00
Michael Dowling
11810f6895 Fixing an issue with generating event arrays and adding missing tests 2014-07-14 16:34:23 -07:00
Michael Dowling
20c10129c3 Fix to ensure that repeated values are parsed correctly 2014-07-11 17:54:10 -07:00
Michael Dowling
c97511c0d7 Adding more robust query string parsing.
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.
2014-07-11 17:25:13 -07:00
Michael Dowling
49a14b2bbc Not applying POST headers until sending
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.
2014-07-07 22:30:38 -07:00
Michael Dowling
0016a005d7 Fixing multi-value header issue with StreamAdapter
Closes #725
2014-07-07 21:38:13 -07:00
Michael Dowling
16767bf79a Fixing a slash URL normalization issue
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.
2014-07-07 16:06:31 -07:00
Jamie Hannaford
597ca11dd1 Make sure path leading slashes aren't added for empty hosts 2014-07-07 16:04:35 +02:00
Michael Dowling
4d3751d8e0 Adding support for GET requests with body 2014-06-11 21:01:44 -07:00
Fred Emmott
4db19b75d9 Change port used for unit tests
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.
2014-06-09 10:18:36 -07:00
Michael Dowling
83a8997158 Implementing toArray() on CookieJar
Adding the ability to create a cookie jar and pass in an array of cookies.
2014-06-07 11:53:47 -07:00
Michael Dowling
7ad15b806f Merge remote-tracking branch 'larowlan/multipart-forms' into fix-multipart-nested 2014-06-04 14:30:46 -07:00
Michael Dowling
6a871f2ba8 Adding a fix to ensure that POST requests can use the json option correctly 2014-06-04 11:17:31 -07:00
floriansemm
9990d52093 failing tests for json post request 2014-06-04 08:35:25 +02:00
Lee Rowlands
7f20c86fb7 Fail demonstrating nested form-fields 2014-06-04 09:02:56 +10:00
Michael Dowling
715a433100 Adding test to ensure adding new message factory options works 2014-06-03 09:43:15 -07:00
Michael Dowling
6503778ae0 Some small HHVM hacks. See #538 2014-05-27 21:58:05 -07:00
Michael Dowling
03e9793efe Added setPort and getPort to RequestInterface.
- Removed request method constants from RequestInterface
- Closes #680
2014-05-27 21:16:50 -07:00
Michael Dowling
dd5eceed5d Adding a json_decode wrapper to functions.php 2014-05-27 10:52:13 -07:00
Michael Dowling
3db1dc3145 Adding the json request option
- Adding the json request option to provide better symmetry
  between request and response APIs.
- Updating the quickstart guide and documentation.
- Closes #674
2014-05-18 12:47:07 -07:00
Jeremy Lindblom
a0146ced57 Extracted the event/listener management portion of the TransactionIterator into a trait. 2014-04-30 13:46:07 -07:00
MarkBaker
71375c1554 Merge remote-tracking branch 'upstream/master' 2014-04-21 23:42:40 +01:00
MarkBaker
b0ede6c7b5 Change persist() to save() and make public, make sessionVar private, and remove unnecessary session header handling and exception trapping in tests 2014-04-19 00:29:34 +01:00
MarkBaker
2ba19b2c8b Use client session to persist the cookie jar 2014-04-18 23:58:24 +01:00
Jeremy Lindblom
33ad112c94 Added an emitter option to the Client 2014-04-17 07:26:16 -07:00
Jeremy Lindblom
1fa4f2a232 Updated test Server class to make sure server is started on flush() 2014-04-16 17:33:59 -07:00
Michael Dowling
222323bd6a Using request_fulluri when using a proxy. Closes #632 2014-04-13 12:17:28 -07:00
Michael Dowling
5887a8b13e Adding the ability to set scalars as post fields. Closes #628 2014-04-11 17:42:00 -07:00
Michael Dowling
4f790df279 303 redirects should not use POST
Closes #618
2014-04-02 22:08:43 -07:00
David Thalmann
576832ab7a Fixes #619 : HTTP Status Code is also Exception code 2014-04-02 22:07:12 +02:00
Michael Dowling
dc841699e0 Adding the batch() convenience function and restructuring the event format for sendAll() 2014-03-29 15:21:56 -07:00
Michael Dowling
e235644d18 Adding testing docs 2014-03-24 21:10:05 -07:00
Michael Dowling
3472f1fb68 Renaming (g|s)etDefaultValue() to (g|s)etDefaultOption() 2014-03-24 19:44:55 -07:00
Michael Dowling
d3943ce1e3 Adding support for HTTP_PROXY and HTTPS_PROXY 2014-03-24 19:00:23 -07:00
Michael Dowling
5a90f97e28 Adding the ability to control the curl_multi select timeout using an envrionment variable 2014-03-24 17:00:15 -07:00
Michael Dowling
78bb8c1420 Ensuring the mock adapter reads the request body and emits a headers event 2014-03-23 15:52:24 -07:00
Michael Dowling
92a11623af Adding perf test to makefile 2014-03-23 10:53:34 -07:00
Michael Dowling
7b257eb0fb Making the test server static and adding Makefile 2014-03-22 22:05:45 -07:00
Michael Dowling
d4e897936c Renaming getDefaults() to getDefaultValue() 2014-03-21 16:54:06 -07:00
Michael Dowling
b30ce5d514 Making clients more immutable
- Removing getConfig() and setConfig() from clients to avoid confusion around
  whether things like base_url, message_factory, etc should be able to be
  retrieved from getConfig() or modified using setConfig().
- Adding getDefaults() and setDefaultValue() to customize default request
  options of a client.
- Updating Url class to check if a scheme and host are set before adding
  ":" and "//". This allows empty Url (e.g., "") to be serialized as "".
- Removing dead code from Url class.
- Adding a functions.php function for get_path and set_path so that these
  functions can be used on regular PHP arrays. Collection now proxies to these
  functions when Collection::(get|set)Path() is called.
- Resolves #599.
2014-03-21 12:37:32 -07:00
Michael Dowling
beaeeb368f Suppressing warnings when unable to parse XML. Closes #602 2014-03-21 10:25:55 -07:00
Michael Dowling
4124f9019e Fixing two failing tests 2014-03-20 20:39:52 -07:00
Michael Dowling
c1f23e10f3 Updating curl adapter to use callable curl factories 2014-03-19 14:42:35 -07:00