Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    So I guess I have curl
    It's working! I had to download CA certificates, and set the path of the file on my php.ini for the curl settings. My code is downloading stuff from the Alpaca API now!
    Hi all! Is there any way to set base_uri in different way than pass it thru constructor?

    $eachPromise = new EachPromise($promises, [
    'concurrency' => 2,
    'fulfilled' => function (Response $response) {
    if ($response->getStatusCode() == 200) {
    $data = json_decode($response->getBody(), true);
    // processing response of user here
    echo "successes";
    'rejected' => function ($reason) {
    echo "fail";

    is there any way for each promise to execute Cade sends after a few seconds?
    For example, at concurrency you have informed 2, so it will send every 2 times, and put a time that after 5 seconds it sends again, similar to a pause at each sending.

    Hi I have a problem
    GuzzleHTTP converting url to capital letters
    Edgar Ibrahimov
    Hi all,
    I use Guzzle to authentication https://auth.prestashop.com/login with method POST and params email, password, and SubmitLogin.
    Before POST request I need also add to here hidden _token params getting from the first request by the GET method to this link. How I can do it with the best practice? Thank you
    Arne Groskurth
    Does anyone know if I can extract the complete HTTP message that is actually send over the wire for both PSR7 request- and response-objects?
    Without writing that myself...
    Arne Groskurth
    FYI: \GuzzleHttp\MessageFormatter
    Mario Bonito
    Hi everyone, just have some issues with concurrency and Digest Authorization. Using Guzzle 6 anyone been successful with that? When I do it one at a time I have no issues, but when I set up a Pool and try concurrent all the request promises fail with 401. I am passing all the credentials correctly and setting the 'auth' in the request. Thoughts?
    Alexander Tarkhov
    Hi guys, I present the second release of the Guzzle XML PHP library for sending XML requests. https://github.com/tarkhov/guzzle-xml/releases/tag/v0.1.1

    Is it possible to run Guzzle as a standalone, without laravel? I am getting this error:

    GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host

    I can ping the host from the server. curl to same address also works. Any way to fix this?


    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.