Skip to content

Tag: guzzle

unable to get response form an API in Laravel [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 months ago. Improve this question I am getting null response in laravel after dd(); ,however in Postman i

Undefined property: $client while trying to get some information

I’m using Laravel v5.8 and guzzlehttp of v7.4 and tried to write this Controller for getting some information: But now when I call the method getInfo, I get this error message: Undefined property: AppHttpControllersTavanmandAppResultController::$client However the docs says calling the uri’s like this. So what’s going wrong here? How can I solve this issue? Answer The scope of your $client

Google Chat API. Can’t create space. Method not found

I’m trying to create a google chat space via making a post request to with Guzzle. In response I’m getting: But if I change the body of the request and add some new invalid fields like this: I’m getting the next response: docs: What’s wrong with my original request? Thanks. Answer The spaces.create documentation explains this at the

Laravel Http Client add api key into request

On my Laravel project (laravel version 9) I have to connect on a third part api using an apikey on the url and I have to get the response in json format. To not having to repeat the same code over and over and over I’m trying to use the Http Client Macro for setting the base url, make sure

Guzzle: Sending POST with Nested JSON to an API

I am trying to hit a POST API Endpoint with Guzzle in PHP (Wordpress CLI) to calculate shipping cost. The route expects a RAW JSON data in the following format: Link to the API I am consuming: I’ve also tried using ‘json’ => $body instead of the ‘body’ parametar. I am getting 400 Bad Request error. Any ideas? Answer

Transforming Twilio library request into Guzzle request

unfortunately our project runs on PHP 7.0 and we cannot upgrade it for now. And Twilio’s library uses PHP 7.2+ on the version that contains the trusthub API support. So I’m trying to do the request “Create EndUser of type: customer_profile_business_information” from this doc page using Guzzle instead of their library, and I’m following instructions from the curl example. Everything