Skip to content

Tag: guzzle

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: https://developers.cjdropshipping.com/api2.0/v1/logistic/freightCalculate I’ve also tried using ‘json&#82…