Questions tagged [guzzle6]

337 questions
3
votes
1 answer

Guzzle Using Proxy

References: http://docs.guzzlephp.org/en/stable/request-options.html#proxy Set proxy in Guzzle Env : GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.1.3-3+deb.sury.org~xenial+1 I am trying to use proxy server with async Guzzle calls. I have discovered that…
Scalable
  • 1,550
  • 4
  • 16
  • 29
3
votes
2 answers

Symfony2 Guzzle store cookie for request

Trying to make my Symfony2 Controller make request to backed API. Need to store the cookie received upon first API request to use it in second request. Here is my Controller code: use Guzzle\Http\Client; use Guzzle\Plugin\Cookie\CookiePlugin; use…
dev
  • 1,119
  • 1
  • 11
  • 34
3
votes
1 answer

Guzzle 400 Bad Request

I get the following error when I'm doing a POST request: Client error: POST http://api.hitbox.tv/auth/login resulted in a 400 Bad Request response: {"success":true,"error":false,"error_msg":"auth_failed"} I'm not sure, is that because I have…
d3no
  • 121
  • 1
  • 3
  • 12
3
votes
0 answers

Guzzle 6 - Don't encode the URL

I'm currently using guzzle for my api requests however the URL is always being encoded. While I understand that this is normal the api I'm using doesn't work with special characters encoded. For example: ★ StatTrak™ Karambit | Case Hardened (Minimal…
Ricky Barnett
  • 1,130
  • 3
  • 15
  • 32
3
votes
1 answer

Guzzle unable to bypass cURL error 35: SSL connect error

Using Guzzle 6 I am attempting to communicate with an Https endpoint that uses a self-signed certificate. I am instantiating my Client class as follows: $authClient = new Client([ 'base_uri' => config('app.auth_uri'), 'verify' =>…
ryrobbo
  • 83
  • 1
  • 6
3
votes
0 answers

Guzzlehttp - Correct way to get same callback called immediately when each request done

While using Guzzle for async requests, I want got same callback immediately when each request done. Following code is works, but I think it's may not make sense. Does Guzzle provide any method like Promise\settle($promises)->then($callback)->wait()…
l99933
  • 149
  • 1
  • 5
3
votes
2 answers

plivo api intallation via composer conflict with guzzle

I am installating plivo api using composer on live server(digital ocean), which running command i getting some dependencies version mismatch errors. plivo required guzzle latest version, but guzzle is already installed in my laravel application but…
3
votes
0 answers

Guzzle 6: add files with "form_params" option

I need to upload files in Guzzle 6 but is mandatory to use "form_params" options. To make a POST request just with data I'm using $client->post('http://xxx/', [ 'form_params' => [ [ 'data' => ['id' => 1234, 'name' =>…
Averias
  • 931
  • 1
  • 11
  • 20
3
votes
1 answer

Guzzle: how to intercept a meta Refresh

I'm using Guzzle to get the HTML of a webpage that on the domain has set a meta Refresh: Guzzle seems not intercept this kind of redirect. Is it correct? Can I…
Aerendir
  • 6,152
  • 9
  • 55
  • 108
3
votes
2 answers

Guzzle 6: Get URL that was "resolved" from base_uri

In Guzzle 3 you can get the resolved URL (without actually opening it) like this: $client = new Client([ 'base_uri' => 'http://foo.com', ]); $request = $client->get('bar.html'); echo $request->getUrl(); In Guzzle 6 this is not working…
Thomas Landauer
  • 7,857
  • 10
  • 47
  • 99
3
votes
1 answer

Default form_params for guzzle 6

Is there a way to globally add form_params to all requests with guzzle 6? For example: $client = new \GuzzleHttp\Client([ 'global_form_params' => [ // This isn't a real parameter 'XDEBUG_SESSION_START' => '11845', 'user_token'…
Parris Varney
  • 11,320
  • 12
  • 47
  • 76
3
votes
1 answer

Guzzle form_params not accepting array

I am using Guzzle 6 and I can't pass array with form_params in the body of the client $postFields = [ form_params => [ 'data[test]' => "TEST", 'data[whatever]' => "Whatever..." ] ]; $client = new GuzzleClient([ …
Petyo Tsonev
  • 567
  • 2
  • 6
  • 19
3
votes
1 answer

guzzle 6.0 call to undefined method GuzzleHttp\Psr7\Response::xml()

I want to check the xml based responses from server, here is an example of the response format. success My existing code, use GuzzleHttp\Client; $client = new Client(); $response =…
Dipendra Gurung
  • 5,720
  • 11
  • 39
  • 62
2
votes
1 answer

What is the correct way to send a JSON POST and header with Guzzle 7?

I need to send this body as JSON, using that header to authenticate. $headers = array( 'Authorization' => "Bearer ".$token->access_token, 'Content-Type' => 'application/json', ); $body = [ 'code1' => '444444', 'code2' =>…
rendor9
  • 172
  • 2
  • 10
2
votes
1 answer

How to send image from Laravel controller to API Rest

I need to take an image from storage in Laravel and send it from a Controller to an external API REST. I am using guzzlehttp multipart but the API didn't receive the file, returns file = null