The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.

Overview
Comments
  • Load Proxy configuration from environment as Native does

    Load Proxy configuration from environment as Native does

    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!

    opened by filisko 3
  • Fixes max_duration not being respected

    Fixes max_duration not being respected

    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.

    opened by r-martins 2
  • Solving the bug with looping the removeDotSegments method in HttpClientTrait

    Solving the bug with looping the removeDotSegments method in HttpClientTrait

    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.

    opened by toxaw 2
  •  possibility to set urlencode to false

    possibility to set urlencode to false

    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'
        ]
    ]);
    
    opened by mbarataPHP 2
  • TraceableHttpClient: increase decorator's priority

    TraceableHttpClient: increase decorator's priority

    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

    opened by adpeyre 1
  • Trim response header name

    Trim response header name

    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.

    opened by nuryagdym 1
  • Warning: Array to string conversion

    Warning: Array to string conversion

    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 :)

    opened by Yoann-TYT 1
Releases(v6.1.9)
  • v6.1.9(Dec 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.8...v6.1.9)

    • bug #47836 TraceableHttpClient: increase decorator's priority (adpeyre)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.17(Dec 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.0.16...v6.0.17)

    • bug #47836 TraceableHttpClient: increase decorator's priority (adpeyre)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.17(Dec 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v5.4.16...v5.4.17)

    • bug #47836 TraceableHttpClient: increase decorator's priority (adpeyre)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.2(Dec 16, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.2.1...v6.2.2)

    • bug #47836 TraceableHttpClient: increase decorator's priority (adpeyre)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0(Nov 30, 2022)

  • v6.1.8(Nov 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.7...v6.1.8)

    • bug #48173 Handle Amp HTTP client v5 incompatibility gracefully (fancyweb)
    • bug #48103 Do not set http_version instead of setting it to null (Tetragramat)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.16(Nov 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.0.15...v6.0.16)

    • bug #48173 Handle Amp HTTP client v5 incompatibility gracefully (fancyweb)
    • bug #48103 Do not set http_version instead of setting it to null (Tetragramat)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.16(Nov 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v5.4.15...v5.4.16)

    • bug #48173 Handle Amp HTTP client v5 incompatibility gracefully (fancyweb)
    • bug #48103 Do not set http_version instead of setting it to null (Tetragramat)
    Source code(tar.gz)
    Source code(zip)
  • v4.4.49(Nov 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v4.4.48...v4.4.49)

    • bug #48103 Do not set http_version instead of setting it to null (Tetragramat)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0-RC1(Nov 25, 2022)

  • v6.2.0-BETA3(Nov 19, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.2.0-BETA2...v6.2.0-BETA3)

    • bug #48173 Handle Amp HTTP client v5 incompatibility gracefully (fancyweb)
    • bug #48103 Do not set http_version instead of setting it to null (Tetragramat)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0-BETA2(Oct 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.2.0-BETA1...v6.2.0-BETA2)

    • bug #47990 Fix retrying requests when the content is used by the strategy (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.7(Oct 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.6...v6.1.7)

    • bug #47990 Fix retrying requests when the content is used by the strategy (nicolas-grekas)
    • bug #47879 Fix buffering after calling AsyncContext::passthru() (nicolas-grekas, lubo13)
    • bug #47854 Don't override header if is x-www-form-urlencoded (Oipnet)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.15(Oct 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.0.14...v6.0.15)

    • bug #47990 Fix retrying requests when the content is used by the strategy (nicolas-grekas)
    • bug #47879 Fix buffering after calling AsyncContext::passthru() (nicolas-grekas, lubo13)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.15(Oct 28, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v5.4.14...v5.4.15)

    • bug #47990 Fix retrying requests when the content is used by the strategy (nicolas-grekas)
    • bug #47879 Fix buffering after calling AsyncContext::passthru() (nicolas-grekas, lubo13)
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0-BETA1(Oct 24, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.6...v6.2.0-BETA1)

    • feature #47950 Add support for "friendsofphp/well-known-implementations" (nicolas-grekas)
    • feature #47936 Add withOptions() to HttplugClient and Psr18Client (nicolas-grekas)
    • feature #47832 Make HttplugClient implement PSR-17 factories instead of Httplug's (nicolas-grekas)
    • feature #46183 Hide sensitive information with SensitiveParameter attribute (GromNaN)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.6(Oct 12, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.5...v6.1.6)

    • bug #47808 Fix seeking in not-yet-initialized requests (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.14(Oct 12, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.0.13...v6.0.14)

    • bug #47808 Fix seeking in not-yet-initialized requests (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.14(Oct 12, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v5.4.13...v5.4.14)

    • bug #47808 Fix seeking in not-yet-initialized requests (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v4.4.47(Oct 12, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v4.4.46...v4.4.47)

    • bug #47808 Fix seeking in not-yet-initialized requests (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.5(Sep 30, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.4...v6.1.5)

    • bug #47441 Bugfix for delayed retryableHttpClient (martkop26)
    • bug #47415 Psr18Client ignore invalid HTTP headers (nuryagdym)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.13(Sep 30, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.0.12...v6.0.13)

    • bug #47441 Bugfix for delayed retryableHttpClient (martkop26)
    • bug #47415 Psr18Client ignore invalid HTTP headers (nuryagdym)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.13(Sep 30, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v5.4.12...v5.4.13)

    • bug #47441 Bugfix for delayed retryableHttpClient (martkop26)
    • bug #47415 Psr18Client ignore invalid HTTP headers (nuryagdym)
    Source code(tar.gz)
    Source code(zip)
  • v4.4.46(Sep 30, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v4.4.45...v4.4.46)

    • bug #47415 Psr18Client ignore invalid HTTP headers (nuryagdym)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.4(Aug 26, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.3...v6.1.4)

    • bug #47145 Fix shared connections not being freed on PHP < 8 (nicolas-grekas)
    • bug #47143 Fix memory leak when using StreamWrapper (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.12(Aug 26, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.0.11...v6.0.12)

    • bug #47145 Fix shared connections not being freed on PHP < 8 (nicolas-grekas)
    • bug #47143 Fix memory leak when using StreamWrapper (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v5.4.12(Aug 26, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v5.4.11...v5.4.12)

    • bug #47145 Fix shared connections not being freed on PHP < 8 (nicolas-grekas)
    • bug #47143 Fix memory leak when using StreamWrapper (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v4.4.45(Aug 26, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v4.4.44...v4.4.45)

    • bug #47145 Fix shared connections not being freed on PHP < 8 (nicolas-grekas)
    • bug #47143 Fix memory leak when using StreamWrapper (nicolas-grekas)
    Source code(tar.gz)
    Source code(zip)
  • v6.1.3(Jul 29, 2022)

    Changelog (https://github.com/symfony/http-client/compare/v6.1.2...v6.1.3)

    • bug #47086 Workaround disabled "var_dump" (nicolas-grekas)
    • bug #46700 Prevent "Fatal error" in data collector (fmata)
    Source code(tar.gz)
    Source code(zip)
  • v6.0.11(Jul 29, 2022)

ReactPHP HttpClient Adapter for Guzzle6, for Guzzle5 check ReactGuzzleRing

react-guzzle-psr7 ReactPHP HttpClient Adapter for Guzzle6, for Guzzle5 check ReactGuzzleRing Installation To install via Composer, use the command bel

Cees-Jan Kiewiet 69 Dec 8, 2022
Composer package providing HTTP Methods, Status Codes and Reason Phrases for PHP

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

Alexander Pas 72 Dec 23, 2022
A simple yet powerful HTTP metadata and assets provider for NFT collections using Symfony

Safe NFT Metadata Provider A simple yet powerful HTTP metadata and assets provider for NFT collections using Symfony.

HashLips Lab 66 Oct 7, 2022
Declarative HTTP Clients using Guzzle HTTP Library and PHP 8 Attributes

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

Waffler 3 Aug 26, 2022
The HttpFoundation component defines an object-oriented layer for the HTTP specification.

HttpFoundation Component The HttpFoundation component defines an object-oriented layer for the HTTP specification. Resources Documentation Contributin

Symfony 8.3k Dec 29, 2022
This package provides the database factory experience to fake Http calls in your testsuite.

This package provides the database factory experience to fake Http calls in your testsuite

DIJ 11 May 2, 2022
Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests

laminas-http provides the HTTP message abstraction used by laminas-mvc, and also provides an extensible, adapter-driven HTTP client library.

Laminas Project 33 Aug 27, 2022
Guzzle, an extensible PHP HTTP client

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

Guzzle 22.3k Jan 2, 2023
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

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

null 3.5k Dec 31, 2022
A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.

Httpful Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the

Nate Good 1.7k Dec 21, 2022
PHP's lightweight HTTP client

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

Kris Wallsmith 1.9k Jan 4, 2023
HTTPlug, the HTTP client abstraction for PHP

HTTPlug HTTPlug, the HTTP client abstraction for PHP. Intro HTTP client standard built on PSR-7 HTTP messages. The HTTPlug client interface is compati

The PHP HTTP group 2.4k Dec 30, 2022
PSR-7 HTTP Message implementation

zend-diactoros Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-diactoros. Master: Develop: Diactoros (pronunciation: /dɪʌ

Zend Framework 1.6k Dec 9, 2022
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

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

php-vcr 1.1k Dec 23, 2022
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

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

null 3.5k Dec 31, 2022
PSR HTTP Message implementations

laminas-diactoros Diactoros (pronunciation: /dɪʌktɒrɒs/): an epithet for Hermes, meaning literally, "the messenger." This package supercedes and repla

Laminas Project 343 Dec 25, 2022
Unirest in PHP: Simplified, lightweight HTTP client library.

Unirest for PHP Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain the

Kong 1.3k Dec 28, 2022
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs

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

null 3.1k Jan 5, 2023
HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7

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

Sunrise // PHP 63 Dec 31, 2022