Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Carine93
    @Carine933_twitter
    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
    phillmac
    @phillmac
    @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
    Cutye
    @SrGutyerrez_twitter
    Hello, why guzzle doesn't execute curl requests in localhost? That's make an infinite request
    Zachary Smith
    @zachisit
    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());
    phillmac
    @phillmac
    @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
    @wecaod_gitlab
    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
    @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
    @bizmate

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

    https://www.bizmate.biz/news/it-articles/multiple-concurrent-guzzle-requests/

    Avinash Dalvi
    @aviboy2006
    Hello i need to know is it possible to create promise for custom function without end point. By using local function calls ?
    Nikolay Deriglaozov
    @nkl90
    Hello! How to describe nested entities in DSP?
    Khushit Shah
    @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
    @nkl90

    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
    @rewogneb_twitter
    Hello, how do I cancel/abort a request in middleware::tap before the request is sent? Thanks
    Simon Podlipsky
    @simPod
    Hello, is there any plan to bump min php version for guzzle/promises? To drop EOLed versions preferably.
    bilal07
    @bilal07
    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?
    thanks
    Marcel Klehr
    @marcelklehr
    Hi there! I have a URL that causes guzzle to just block forever, what could cause this?
    Marcel Klehr
    @marcelklehr
    I have set connect_timeout and read_timeout
    Pietro Marangon
    @Pe46dro
    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_RETURNTRANSFER => true,
      CURLOPT_ENCODING => '',
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 0,
      CURLOPT_FOLLOWLOCATION => true,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_POSTFIELDS => $string_params,
      CURLOPT_HTTPHEADER => array(
        'Content-Type: application/x-www-form-urlencoded'
      ),
    ));
    $response = curl_exec($curl);
    curl_close($curl);
    
    $client = new Client();
    $client->request('POST', $url, [
        'form_params' => $array_params
    ]);
    Diego Gullo
    @bizmate

    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
    @Pe46dro

    @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
    @bizmate
    @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
    teng
    @RandalTeng
    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
    @proofek_twitter
    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
    @Pe46dro
    @bizmate the problem was on the remote endpoint 🤦‍♂️
    Thanks
    Buzz
    @davidbuzz
    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.
    Buzz
    @davidbuzz
    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";
    }
    print("\n");
    echo (string) $transaction['request']->getBody(); // Hello World
    }
    print("\n");
    ... jsut to SEE the request it was making.
    vidyli
    @vidyli
    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?
    atumpt
    @atumpt
    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
    @dariopetraroia
    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
    @dariopetraroia
    The array like 30/50 promises
    The array contain*…
    Alexsander
    @Norbytus
    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
    ps-mattstuart
    @ps-mattstuart
    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
    rlzdesenv
    @rlzdesenv

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

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

    rlzdesenv
    @rlzdesenv
    resolved
    Killian Weidner
    @killianweid
    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 ?
    huypxgear
    @huypxgear
    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?