"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Http/Client.php" between
cakephp-4.0.1.tar.gz and cakephp-4.0.2.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

Client.php  (cakephp-4.0.1):Client.php  (cakephp-4.0.2)
skipping to change at line 30 skipping to change at line 30
use Cake\Core\InstanceConfigTrait; use Cake\Core\InstanceConfigTrait;
use Cake\Http\Client\Adapter\Curl; use Cake\Http\Client\Adapter\Curl;
use Cake\Http\Client\Adapter\Stream; use Cake\Http\Client\Adapter\Stream;
use Cake\Http\Client\AdapterInterface; use Cake\Http\Client\AdapterInterface;
use Cake\Http\Client\Request; use Cake\Http\Client\Request;
use Cake\Http\Client\Response; use Cake\Http\Client\Response;
use Cake\Http\Cookie\CookieCollection; use Cake\Http\Cookie\CookieCollection;
use Cake\Http\Cookie\CookieInterface; use Cake\Http\Cookie\CookieInterface;
use Cake\Utility\Hash; use Cake\Utility\Hash;
use InvalidArgumentException; use InvalidArgumentException;
use Laminas\Diactoros\Uri;
use Psr\Http\Client\ClientInterface; use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface; use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Zend\Diactoros\Uri;
/** /**
* The end user interface for doing HTTP requests. * The end user interface for doing HTTP requests.
* *
* ### Scoped clients * ### Scoped clients
* *
* If you're doing multiple requests to the same hostname it's often convenient * If you're doing multiple requests to the same hostname it's often convenient
* to use the constructor arguments to create a scoped client. This allows you * to use the constructor arguments to create a scoped client. This allows you
* to keep your code DRY and not repeat hostnames, authentication, and other opt ions. * to keep your code DRY and not repeat hostnames, authentication, and other opt ions.
* *
skipping to change at line 540 skipping to change at line 540
{ {
$headers = (array)($options['headers'] ?? []); $headers = (array)($options['headers'] ?? []);
if (isset($options['type'])) { if (isset($options['type'])) {
$headers = array_merge($headers, $this->_typeHeaders($options['type' ])); $headers = array_merge($headers, $this->_typeHeaders($options['type' ]));
} }
if (is_string($data) && !isset($headers['Content-Type']) && !isset($head ers['content-type'])) { if (is_string($data) && !isset($headers['Content-Type']) && !isset($head ers['content-type'])) {
$headers['Content-Type'] = 'application/x-www-form-urlencoded'; $headers['Content-Type'] = 'application/x-www-form-urlencoded';
} }
$request = new Request($url, $method, $headers, $data); $request = new Request($url, $method, $headers, $data);
/** @var \Cake\Http\Client\Request $request */
$request = $request->withProtocolVersion($this->getConfig('protocolVersi on')); $request = $request->withProtocolVersion($this->getConfig('protocolVersi on'));
$cookies = $options['cookies'] ?? []; $cookies = $options['cookies'] ?? [];
/** @var \Cake\Http\Client\Request $request */ /** @var \Cake\Http\Client\Request $request */
$request = $this->_cookies->addToRequest($request, $cookies); $request = $this->_cookies->addToRequest($request, $cookies);
if (isset($options['auth'])) { if (isset($options['auth'])) {
$request = $this->_addAuthentication($request, $options); $request = $this->_addAuthentication($request, $options);
} }
if (isset($options['proxy'])) { if (isset($options['proxy'])) {
$request = $this->_addProxy($request, $options); $request = $this->_addProxy($request, $options);
} }
 End of changes. 3 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)