HttpClient component
The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.
The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.
Hi, I just added a way to load proxy configuration from environment. I tried the do it as similar as possible to NativeHttpClient.
What do you think?
Thanks!
As reported on #46316, when a request gets a successful response in further attempts, the max_duration
is not respected and the request may take longer than the value especified here.
My way to solve the issue was by reducing the timeout option in future requests, making it smaller in every attempt. By doing so, the total time of a $client->request will never be much longer than max_duration
. Perhaps a second or two maybe, due to the waiting time between requests, but not as much as the timeout
.
Testing options: '/a/b', 'a/b', 'a/b/', '/a/b/',
When updating packages in one of my project, a bug was caught where sentry/sdk v 2.2.0 in the new version uses this package, for this reason, the start of checking the work of the sentry, the completion occurred with a memory overflow.
The feature offers a choice on encoding query
Q | A -- | -- Branch? | master Bug fix? | no New feature? | yes BC breaks? | no Deprecations? | no Tests pass? | yes Fixed tickets | License | MIT Doc PR |
example:
$httpClient = HttpClient::create();
$response = $httpClient->request('GET', 'http://example.com', [
'query'=>[
'key_1'=>['value'=>'example1,example2', 'urldecode'=>false],
'key_2'=>'normal'
]
]);
Hello,
When I decorate my http client, all requests are not collected (and visible in the profiler) because of the decorator's priority of TraceableHttpClient. I think it should be in increased. I fixed an arbitrary value of 100.
What do you think about that ?
Ty
Hi, I working on a library that I am working on supports PSR-18 and PSR-7 implementations. I tried following PSR-7 libraries: nyholm/psr7 laminas/laminas-diactoros slim/psr7
and following PSR-18 clients: php-http/curl-client symfony/http-client guzzlehttp/guzzle
and when I tried combination of all these PSR-7 and PSR-18 libraries.
I faced issue only on symfony/http-client
Psr18Client client.
Error is caused when I received response with header name containing leading space " x-xss-protection". This library does not trim response header names that is why all 3 PSR-7 libraries throwing error "Header values must be RFC 7230 compatible strings" when used in combination with symfony/http-client
.
The other 2 PSR-18 clients trim header names:
guzzlehttp/guzzle: GuzzleHttp\Handler\CurlFactory::createHeaderFn()
php-http/curl-client: Http\Client\Curl\Client::prepareRequestOptions()
So, I added trim line on Psr18Client, hope it does not break anything, it is working for me at least.
I guess this fix should be done on all maintained versions of this library as well.
PS
I also, tried to trim using Symfony\Component\HttpClient\HttpClientTrait::normalizeHeaders()
but it does not do anything about this leading space in the header name.
Hi everybody !
When you try to send multidimensional arrays, you get the error "Warning: Array to string conversion". I don't know if it the best way to fix it... but works for me.
Thanks for reading me :)
Changelog (https://github.com/symfony/http-client/compare/v6.1.8...v6.1.9)
Changelog (https://github.com/symfony/http-client/compare/v6.0.16...v6.0.17)
Changelog (https://github.com/symfony/http-client/compare/v5.4.16...v5.4.17)
Changelog (https://github.com/symfony/http-client/compare/v6.2.1...v6.2.2)
Changelog (https://github.com/symfony/http-client/compare/v6.2.0-RC2...v6.2.0)
Changelog (https://github.com/symfony/http-client/compare/v6.1.7...v6.1.8)
Changelog (https://github.com/symfony/http-client/compare/v6.0.15...v6.0.16)
Changelog (https://github.com/symfony/http-client/compare/v5.4.15...v5.4.16)
Changelog (https://github.com/symfony/http-client/compare/v4.4.48...v4.4.49)
Changelog (https://github.com/symfony/http-client/compare/v6.2.0-BETA3...v6.2.0-RC1)
Changelog (https://github.com/symfony/http-client/compare/v6.2.0-BETA2...v6.2.0-BETA3)
Changelog (https://github.com/symfony/http-client/compare/v6.2.0-BETA1...v6.2.0-BETA2)
Changelog (https://github.com/symfony/http-client/compare/v6.1.6...v6.1.7)
Changelog (https://github.com/symfony/http-client/compare/v6.0.14...v6.0.15)
Changelog (https://github.com/symfony/http-client/compare/v5.4.14...v5.4.15)
Changelog (https://github.com/symfony/http-client/compare/v6.1.6...v6.2.0-BETA1)
withOptions()
to HttplugClient
and Psr18Client
(nicolas-grekas)SensitiveParameter
attribute (GromNaN)Changelog (https://github.com/symfony/http-client/compare/v6.1.5...v6.1.6)
Changelog (https://github.com/symfony/http-client/compare/v6.0.13...v6.0.14)
Changelog (https://github.com/symfony/http-client/compare/v5.4.13...v5.4.14)
Changelog (https://github.com/symfony/http-client/compare/v4.4.46...v4.4.47)
Changelog (https://github.com/symfony/http-client/compare/v6.1.4...v6.1.5)
Changelog (https://github.com/symfony/http-client/compare/v6.0.12...v6.0.13)
Changelog (https://github.com/symfony/http-client/compare/v5.4.12...v5.4.13)
Changelog (https://github.com/symfony/http-client/compare/v4.4.45...v4.4.46)
Changelog (https://github.com/symfony/http-client/compare/v6.1.3...v6.1.4)
Changelog (https://github.com/symfony/http-client/compare/v6.0.11...v6.0.12)
Changelog (https://github.com/symfony/http-client/compare/v5.4.11...v5.4.12)
Changelog (https://github.com/symfony/http-client/compare/v4.4.44...v4.4.45)
Changelog (https://github.com/symfony/http-client/compare/v6.1.2...v6.1.3)
Changelog (https://github.com/symfony/http-client/compare/v6.0.10...v6.0.11)
react-guzzle-psr7 ReactPHP HttpClient Adapter for Guzzle6, for Guzzle5 check ReactGuzzleRing Installation To install via Composer, use the command bel
HTTP Enums For PHP 8.1 and above This package provides HTTP Methods, Status Codes and Reason Phrases as PHP 8.1+ enums All IANA registered HTTP Status
Safe NFT Metadata Provider A simple yet powerful HTTP metadata and assets provider for NFT collections using Symfony.
Waffler How to install? $ composer require waffler/waffler This package requires PHP 8 or above. How to test? $ composer phpunit Quick start For our e
HttpFoundation Component The HttpFoundation component defines an object-oriented layer for the HTTP specification. Resources Documentation Contributin
This package provides the database factory experience to fake Http calls in your testsuite
laminas-http provides the HTTP message abstraction used by laminas-mvc, and also provides an extensible, adapter-driven HTTP client library.
Guzzle, PHP HTTP client Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interf
Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar
Httpful Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the
Buzz - Scripted HTTP browser Buzz is a lightweight (<1000 lines of code) PHP 7.1 library for issuing HTTP requests. The library includes three clients
HTTPlug HTTPlug, the HTTP client abstraction for PHP. Intro HTTP client standard built on PSR-7 HTTP messages. The HTTPlug client interface is compati
zend-diactoros Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-diactoros. Master: Develop: Diactoros (pronunciation: /dɪʌ
This is a port of the VCR Ruby library to PHP. Record your test suite's HTTP interactions and replay them during future test runs for fast, determinis
Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar
laminas-diactoros Diactoros (pronunciation: /dɪʌktɒrɒs/): an epithet for Hermes, meaning literally, "the messenger." This package supercedes and repla
Unirest for PHP Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain the
PHP Curl Class: HTTP requests made easy PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. Installation Requirements Quic
HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7 Installation composer require sunrise/http-header-kit How to use? HTTP Header Collection Mor