Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info

    what is this? example:

    composer upgrade guzzlehttp/guzzle
    Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.

    composer remove guzzle/guzzle
    guzzle/guzzle is not required in your composer.json and has not been removed

    @Carine933_twitter The guzzle package got renamed. You should use the new name iff possible
    But what should I do? I can't remove guzzle/guzzle. "guzzle/guzzle is not required in your composer.json and has not been removed" and "Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead."
    I have ofcourse VPS, 755, user/group=www-data/www-data
    @Carine933_twitter If you're just typing to install something and everything is working then there is no problem and you can safely ignore the warning. If you are a developer and you use guzzle as a dependency then you should look at updating the dependency
    Hello, why guzzle doesn't execute curl requests in localhost? That's make an infinite request
    Zachary Smith
    Hi all. When I send a POST request with Guzzle, it returns the response but as an HTML and not json if the response returns an error. For successful responses it is a json response. Am I doing something wrong?
    $this->client = new Client(['base_uri' => $this->returnBaseUrl()]);
    $this->response = $this->client->request($this->method,$this->returnRequestURI(),$this->buildRequest());
    @zachisit its possible that this is the server's fault rather then your fault
    If the server is configured whith only default error messages, it's likeley that they are static html rather then json
    Abdallah Alkahlout
    Hi dears , i want to call a thousand request in guzzle once time and ensure each callback correct
    how i can do that
    Alexander Tarkhov
    hey guys Guzzle XML library released with Guzzle 7 support, send xml request and response only by passing array as option which is automatically transformed into xml https://github.com/tarkhov/guzzle-xml
    Diego Gullo

    Hi dears , i want to call a thousand request in guzzle once time and ensure each callback correct


    Avinash Dalvi
    Hello i need to know is it possible to create promise for custom function without end point. By using local function calls ?
    Nikolay Deriglaozov
    Hello! How to describe nested entities in DSP?
    Khushit Shah
    Hello, How can I only download a webpage up until a <title> tag? I don't want to download whole page.
    Nikolay Deriglaozov

    Hello, How can I only download a webpage up until a <title> tag? I don't want to download whole page.

    You cannot get only part of the page content, unless the server provides for it

    Ben Gower
    Hello, how do I cancel/abort a request in middleware::tap before the request is sent? Thanks
    Simon Podlipsky
    Hello, is there any plan to bump min php version for guzzle/promises? To drop EOLed versions preferably.
    require_once "vendor/autoload.php";
    use GuzzleHttp\Client;
    $client = new Client([
        // Base URI is used with relative requests
        'base_uri' => 'https://api.ma.io',
       // \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath()
    $response = $client->request('POST', '/tok/gen, [
        'verify'  => false,
        'headers' => [
            'Accept'     => 'application/json',
            'Content-Type'  => 'application/x-www-form-urlencoded'
        'json' => [
            'username' => 'email@gmail.com',
            'password' => 'pass123'
    i have the error
    PHP Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 35: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
    Any ideas?
    Marcel Klehr
    Hi there! I have a URL that causes guzzle to just block forever, what could cause this?
    Marcel Klehr
    I have set connect_timeout and read_timeout
    Pietro Marangon
    Hi all, I'm struggling with a problem regarding request time, I'm trying to find if the problem is on guzzle side or on remote side, I have the following code that made the request twice, the first time with cURL the second time with Guzzle, the first request (code generated by postman) require 1 second to recive the response, the second request with guzzle require 20 seconds for the response. I'm on Windows 10 / PHP 8.0.3. Postman require the same time as cURL. This can't be a DNS problem since I'm using IP in $url. Is a bug on Guzzle or I'm doing something wrong?
    $curl = curl_init();
    curl_setopt_array($curl, array(
      CURLOPT_URL => $url,
      CURLOPT_POSTFIELDS => $string_params,
      CURLOPT_HTTPHEADER => array(
        'Content-Type: application/x-www-form-urlencoded'
    $response = curl_exec($curl);
    $client = new Client();
    $client->request('POST', $url, [
        'form_params' => $array_params
    Diego Gullo

    Ciao Pietro, ensure the request made with Guzzle is the same as the curl one and then try again...

    see https://docs.guzzlephp.org/en/stable/request-options.html

    Pietro Marangon

    @bizmate thanks for your reply, maybe i'm wrong but

      CURLOPT_RETURNTRANSFER => true, <-- Not relevant for Guzzle
      CURLOPT_ENCODING => '',  <-- Act with default like Guzzle
      CURLOPT_MAXREDIRS => 10, <-- Follow redirection are enable by default on Guzzle ( I'm calling a direct endpoint I don't have any redirection)
      CURLOPT_TIMEOUT => 0, <-- Same as Guzzle default
      CURLOPT_FOLLOWLOCATION => true, <-- The endpoint don't return any Location heade
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, <-- HTTP 1.1 is Guzzle default
      CURLOPT_CUSTOMREQUEST => 'POST', <-- Specified in request
      CURLOPT_POSTFIELDS => $string_params, <-- Specified as array
      CURLOPT_HTTPHEADER => array('Content-Type: application/x-www-form-urlencoded'), <-- Set because `form_params` specified (?)

    I also tried without antivirus but it don't resolve the problem
    I'm starting to think that is a Guzzle bug and maybe i can move this to Github issues

    Diego Gullo
    @Pe46dro if there is not difference then I am unsure what would be causing the problem. Before opening a github ticket I would suggest you open a packet sniffer such as Wireshark and see what the different is at low level directly in the packets between the Curl vs Guzzle requests
    hello everyone, I'm wondering that is the "fire and forget" request, with guzzle HTTP client, is just delaying the request to the script end and send?
    Sebastian Marek
    morning all, I’ve got a question about ServiceBuilder. I need to upgrade from a non supported version of guzzle and I wonder how to use a ServiceBuilder or an equivalent in guzzle 7?
    Pietro Marangon
    @bizmate the problem was on the remote endpoint 🤦‍♂️
    guzzle seems to do some magic involving adding Content-Length and Content-Type attributes inside a Content-Disposition: form-data; name="file"; filename="xxxx" block.... is htere a way to make it NOT?
    I've got a server that doesn't like it, and i have some python code that doesn't have it and POSTs to the remote server fine... and i'm just trying to implement the same in guzzlephp and failing.
    after spending too many hrs on this crap ( including an attempt at writing a midleware that undoes what guzzle magic was done and failing), i've given up on guzzle, and i'm going back to php's curl
    all i was trying to do was a custom x-blah header, a POST with multipart/form-data with a file name="file"; filename="..."
    terrible request logging, why does 'debug' => true not just give the entire REQUEST including headers and body?
    i had to use a $history = Middleware::history($container);
    and after the request is actioned a
    foreach ($container as $transaction) {
    foreach ($transaction['request']->getHeaders() as $name => $values) {
    echo $name . ': ' . implode(', ', $values) . "\r\n";
    echo (string) $transaction['request']->getBody(); // Hello World
    ... jsut to SEE the request it was making.
    hi, I need to proxy a request to another server using php, that is , create a guzzle request from php global variables, such as $_GET, $_POST, $_FILES, any example please?
    Hello. I use the ->getConfig() method on my client to retrieve cookies for later use (essentially maintaining session over different program calls). Since this method is getting deprecated, is there an alternative way to grab the cookie jar from the client? I tried checking the documentation, but the website is timing out for me.
    Dario Petraroia
    hy is there any way to make this quickier:
    $time_start_pool = microtime(true);
    $responses = Promise\Utils::settle($promises)->wait();
    $time_end_pool = microtime(true);
    $execution_time['pool'] = ($time_end_pool - $time_start_pool);
    $promises[] = $this->client->postAsync('https://test.com ');
    Dario Petraroia
    The array like 30/50 promises
    The array contain*…
    Hello, i have problem with guzzle, where receive 502 bad gate way from server, and guzzle not call CurlFactory::createRejection, $easy->errno = 0. Help please
    I'm having the oddest problem where my composer won't include the psr7/src/functions_include.php in the list of autoloaded files. In .lock the autoload block for psr7 has just the psr-4 section, in the static loader list the promises & guzzle function loaders are there but the psr7 one isn't. Running composer 2.2.4, guzzle 7.4.1, promises 1.5.1, and psr7 2.1.0. Reinstalling the composer libraries, redoing the dump, etc. all result in the same thing. The missing reference to the functions loader. The 7.4.1 guzzle client still uses the deprecated psr7 functions and it's causing issues. Edit: never mind, the newest guzzle psr7 doesn't have the autoload files I thought it did

    I need to suggest a save name in the file, when downloading the stream

    <?php $this->client->request('GET', $uri, ['query' => $params, 'stream' => true]);

    Killian Weidner
    Hello, I would like to put a delay of 1sec between package of 10 requests sended simultaneously. Is it possible with Guzzle ? I have to use Pool ?
    Hi everyone, I got an issue when making a request. My request response body is incorrect. It seems the request URL is rebuilt again to other URL which cause the response body invalid
    Is there anyone know how to resolve it?