The change log shows what have been Added, Changed, Deprecated and Removed between versions.
MultiCurl
will never throw exception when handling messages asynchronously. All exceptions will be handled in the callback.MultiCurl::sendRequest()
will throw exception if one occur.- Make sure
MultiCurl::proceed()
is non-blocking.
ContentTypeMiddleware
that automatically detects content type of the body.
- It is now mandatory to pass a client to the
Browser
's constructor. - First argument of
Curl
,MultiCurl
andFileGetContent
clients should be the response factory. - Using stable version of
psr/http-client
.
- Added parameter for
ResponseFactory
toAbstractClient
constructor. - Added parameter for
RequestFactory
toBrowser
constructor.
- Not passing a RequestFactory to
Browser
. - Not passing a ResponseFactory to the client's constructor.
- Not passing a BuzzClientInterface to the
Browser
's constructor.
- Updated composer.json to show that we provide
php-http/client-implementation: 1.0
.
- The first argument to all client constructors is an array of options.
- A way to configure default options for a client:
AbstractClient::configureOptions(OptionsResolver $resolver)
- Added
ParameterBag
to store options. - Added
BatchClientInterface::sendAsyncRequest(RequestInterface $request, array $options = [])
. - Added
BuzzClientInterface::sendRequest(RequestInterface $request, array $options = []): ResponseInterface
. - Ported all Listeners to Middlewares.
- Added options to configure the client as constructor argument and when you send a request.
- Removed
Request
andResponse
- Removed
AbstractStream
. - Removed all listeners and
ListenerInterface
- Removed
Curl::getInfo()
- Client functions like
AbstractClient::setIgnoreErrors()
,AbstractClient::getIgnoreErrors()
,AbstractClient::setMaxRedirects()
,AbstractClient::getMaxRedirects()
,AbstractClient::setTimeout()
,AbstractClient::getTimeout()
,AbstractClient::setVerifyPeer()
,AbstractClient::getVerifyPeer()
,AbstractClient::getVerifyHost()
,AbstractClient::setVerifyHost()
,AbstractClient::setProxy()
andAbstractClient::getProxy()
.
- Redirects are not followed by default
- No exceptions are thrown and no warnings are triggered on a invalid response.
- We only handle PSR requests and responses.
- Renamed
Browser::call($url, $method, $headers, $body)
toBrowser::request($method, $url, $headers, $body)
.
BasicAuthMiddleware
,BearerAuthMiddleware
,ContentLengthMiddleware
andLoggerMiddleware
.Browser::submitForm
- Support for middleware chain when using
BatchClientInterface
FormRequestBuilder
to help build a "form request".- Added HTTP status code constants to
Response
.
- Used Curl read function for large bodies.
- Deprecated
Browser::send
in favor forBrowser::sendRequest
- Deprecated
Browser::submit
in favor forBrowser::submitForm
- Make sure
Browser
does not call deprecated functions.
- ClientInterface supports PSR7 requests and responses.
- Removed type hint for second parameter for
AbstractCurl::prepare
. - Removed type hint for second parameter for
RequestException::setRequest
. - Removed type hint for first parameter for
AbstractStream::getStreamContextArray
. RequestException
supports both PSR-7 requests and Buzz requests.Response::getProtocolVersion
will return a string and not a float.- Using PHPUnit namespaces.
- Added Request and Response converters
- Added
Curl::sendRequest()
,MultiCurl::sendRequest()
andFileGetContents::sendRequest()
that supports sending PSR-7 requests. - Added
Browser::sendRequest()
that supports middlewares. - Added
MiddlewareInterface
andBrowser::addMiddleware()
. - Added
HeaderConverter
to convert between PSR-7 styled headers and Buzz styled headers.
Curl::send()
,MultiCurl::send()
andFileGetContents::send()
in favor for*::sendRequest()
.AbstractCurl::populateResponse()
was deprecated in favor ofAbstractCurl::createResponse()
.
- Support for PHP 5.3.
- A
.gitattributes
was added to exclude test files and metadata.
- The reason phrase is allowed to be empty.
MultiCurl
will throw exception when request fails. This makesMultiCurl
to have the same behavior asCurl
andFileGetContents
. (Liskov Substitution Principle)
- Added
BearerAuthListener
- We use PSR-4 instead of PSR-0
- Moved cookie jar implementation from
FileGetContents
client to a browser listener - Added
DigestAuthListener
- Changed default HTTP protocol version to 1.1
- Added verify host control to
AbstractClient