guzzle6 Questions
2
Solved
I have a PHP webapp that makes requests to another PHP API. I use Guzzle to make the http requests, passing the $_COOKIES array to $options['cookies']. I do this because the API uses the same Larav...
2
Solved
New to Guzzle/Http.
I have a API rest url login that answer with 401 code if not authorized, or 400 if missing values.
I would get the http status code to check if there is some issues, but canno...
Squeamish asked 2/5, 2018 at 12:53
2
I want to upload files in chunks to a URL endpoint using guzzle.
I should be able to provide the Content-Range and Content-Length headers.
Using php I know I can split using
define('CHUNK_SIZE',...
2
I don't really understand how to catch an exception (forward it) within the onReject handler. I was wondering if anyone can point me in the right direction on how to successfully do so.
I'm sendin...
1
Solved
Problem
We are trying to do concurrent asynchronous requests using guzzle. After going through a few resources, like this and this, we came up with some code that is shared below. However it is not...
0
I have a task to identify the existence of the links. As a result I am using guzzle client to identify if the link is existence or not, i.e if the response header received is 200, then the link is ...
Figurant asked 26/5, 2017 at 14:17
4
Solved
Can anyone explain how to add the Authorization Header within Guzzle? I can see the code below works for adding the username & password but in my instance I just want to add the Authorization h...
2
I am trying to asynchronously download files with Guzzle 6, but the documentation seems vague and couldn't find any useful examples.
The thing I am not sure about is - how am I supposed to save th...
2
Solved
Is there any way to mock response and request in Guzzle?
I have a class which sends some request and I want to test.
In Guzzle doc I found a way how can I mock response and request separately. Bu...
Roesch asked 9/2, 2017 at 15:31
2
Solved
My objective is to use Guzzle 6 to create a pool of asynchronous requests that PUT json data. Then monitor each $promise success/failure.
For comparison to my POOL code example, the following sing...
Medium asked 7/4, 2016 at 20:0
3
Solved
You can execute http requests in parallel using Guzzle's Pool:batch() method. It allows you to set default options for requests using options key in the third parameter.
But what if I need differe...
1
Solved
I am using Guzzle concurrency request tool:
http://docs.guzzlephp.org/en/latest/quickstart.html#concurrent-requests
My code is similar to the example code:
use GuzzleHttp\Pool;
use GuzzleHttp\Cli...
1
Solved
I am using Guzzle 6.
I am trying to mock a client and use it like so:
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
...
2
Solved
In a Google Oauth2 implementation I'm trying to exchange an authorization code for tokens using a guzzle call.
The following guzzle call works fine and returns the expected values:
$result = $th...
Christyna asked 2/3, 2016 at 15:0
1
Solved
I need to send multiple requests so I want to implement a batch request.
How can we do it in Guzzle6?
Using the the old way:
$client->send(array(
$client->get($courses), //api url
$clien...
1
Solved
I've a page doing some REST queries using Guzzle 6. It works fine, however sometimes it gets too slow because it's always making queries. I found out that there is guzzle-cache-middleware that is s...
2
With Guzzle, do promises provide any real utility? It seems that you must call wait(). The following code (from the docs) seems to do nothing by itself:
$promise = $client->requestAsync('GET', ...
Amlie asked 21/3, 2016 at 22:55
1
Solved
I want to download a large file with Guzzle and want to track the progress. I don't know if I have to pass a stream or use the RequestMediator somehow.
I tried with subscribing to the event curl....
1
Solved
I'm trying to upgrade a class to use GuzzleHttp\Client to search tweets using twitter api. I'm having trouble attaching Oauth1. It worked fine with Guzzle3 and OAuthPlugin.
Here is the code block:...
Oarfish asked 8/9, 2015 at 17:27
1
Solved
I'm trying to profile the requests made to an API server from a PHP client using Guzzle (v 6).
In the Guzzle 5.3 there is this complete and before event handling.
class GuzzleProfiler implements...
© 2022 - 2024 — McMap. All rights reserved.