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...
Fondly asked 7/8, 2015 at 16:1

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',...
Origami asked 19/7, 2017 at 6:37

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...
Sneaker asked 5/6, 2016 at 20:47

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...
Blandishments asked 2/9, 2017 at 15:49

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...
Aprylapse asked 15/3, 2016 at 12:48

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...
Ofris asked 23/8, 2015 at 22:49

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...
Disposure asked 6/8, 2015 at 13:30

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...
Apostle asked 13/10, 2016 at 7:52

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; ...
Piperine asked 28/9, 2016 at 17:12

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...
Fradin asked 24/6, 2015 at 6:59

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...
Guanase asked 22/5, 2016 at 18:35

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', ...
Am‚lie 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....
Genisia asked 21/1, 2016 at 6:6

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...
Humming asked 7/8, 2015 at 4:28

© 2022 - 2024 — McMap. All rights reserved.