Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    still-dreaming-1
    @still-dreaming-1
    So I guess I have curl
    still-dreaming-1
    @still-dreaming-1
    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!
    rpicheta
    @rpicheta
    Hi all! Is there any way to set base_uri in different way than pass it thru constructor?
    DiegoFSFlor
    @DiegoFSFlor

    $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.

    Quiec
    @Quiec
    Hi I have a problem
    GuzzleHTTP converting url to capital letters
    Quiec
    @Quiec
    CURLE_URL_MALFORMAT
    Edgar Ibrahimov
    @eibrahimov
    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
    @arnegroskurth
    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
    @arnegroskurth
    FYI: \GuzzleHttp\MessageFormatter
    Mario Bonito
    @elite6adger
    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
    @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
    hershkoy
    @hershkoy

    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?

    Carine93
    @Carine933_twitter

    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

    phillmac
    @phillmac
    @Carine933_twitter The guzzle package got renamed. You should use the new name iff possible
    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.