Questions tagged [guzzle]

Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Guzzle can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries like React.

Guzzle is a PHP HTTP client & framework for building RESTful web service clients.


Features:

  • Extremely powerful API provides all the power of cURL with a simple interface.
  • Truly take advantage of HTTP/1.1 with persistent connections, connection pooling, and parallel requests.
  • Service description DSL allows you build awesome web service clients faster.
  • Symfony 2 event-based plugin system allows you to completely modify the behavior of a request.
  • Includes a custom Node.js web server to test your clients. Unit-tested with PHPUnit with 100% code coverage.

Documentation:

2576 questions
0
votes
1 answer

How to post json data containing a file field with Guzzle?

I'm trying to send the following data to a REST API with Guzzzle { "documents": { "id_proprietaire": 28, "nom_proprietaire": "rash", "prenom_proprietaire": "rash", "code_identification": "9LS9PB094MIL9CPL", …
0
votes
1 answer

Get first array from multiples endpoints async request

I have the guzzle configured which currently uses getAsync with 4 urls promise. The return of this data comes with 2 arrays, of this format below. My question, how can I separate into two variables, the first being just the first array? In this…
Renan Bessa
  • 429
  • 1
  • 6
  • 13
0
votes
1 answer

How to pass id parameter using php laravel?

I want to pass the id from the controller to route but I'm having trouble with it. I am a newbie at this so I would really appreciate your help! Controller: public function fetchVideo(Request $request) { $client = new Client(); $input =…
Alison
  • 5
  • 4
0
votes
1 answer

Odd problem with PHP Curl and guzzle in Laravel

I'm trying to interact with a WS. This WS accept post requests in multipart and also in x-www-urlencoded. The WS is an OCR service, you send a passport picture and the WS returns a json with the MRZ data. When I try the WS with postman always works,…
Miquel Àngel
  • 149
  • 1
  • 3
  • 11
0
votes
1 answer

Login into Moodle using a token

I am trying to figure out a solution on how to login into Moodle from an external API service. I have web services enabled on Moodle. My application uses a API build with Laravel which contains a method to login in directly to Moodle from another…
Karan
  • 258
  • 1
  • 3
  • 12
0
votes
1 answer

GuzzleHttp\Exception\ConnectException: Connection refused for URI

I try to scrape a websites HTML code with a guzzle http-request. In the browser (chrome) everything works fine, but when I try to execute the PHP script with the console (windows) I get the following error: GuzzleHttp\Exception\ConnectException:…
Mathis Hüttl
  • 127
  • 3
  • 18
0
votes
1 answer

How to display API Get Response (HTML) to a new window tab / iframe

I'm creating a Laravel project and trying to display a HTML response in a GET API. My goal is when a user clicks the button / href, a new tab will open and he/she will be redirected to the HTML response from the GET API. Here's my sample Guzzle…
0
votes
0 answers

PHP foreach with API calls on id

I am trying to add data from 2 APIs to my database (using CraftCMS). I am querying 2 endpoints - one of which queries all posts (/postings) then another queries each post (/postings/). I am currently looping through each item in the postings API…
Peter Ayello Wright
  • 127
  • 1
  • 3
  • 13
0
votes
1 answer

Windows PHP with cURL error 77: error setting certificate verify locations

I'm using PHP 7.4 on a Windows server via commandline (think executing IDE PHPUnit tests - no HTTP server involved), and I am trying to access a remote server via CURL extension (wrapped inside Guzzle) via HTTPS. CURL/Guzzle responds with errors…
Sven
  • 69,403
  • 10
  • 107
  • 109
0
votes
1 answer

Paypal - Capture Order - TypeError: strtolower(): Argument #1 ($string) must be of type string, int given

I am trying to use PayPal as a payment method on my website. I am using Laravel framework and GuzzleHttp package. Creating an order runs smoothly. Problem comes when trying to capture an order using id. php artisan tinker >>> $paypal = new…
0
votes
1 answer

Laravel guzzle post request remote database error

There is a Laravel 5.8 named core and Lumen 8 named log in my localhost. The core posts request to log and it must store the data into its database. They have separate database named core_db and log_db. This is the log store method public function…
M a m a D
  • 1,938
  • 2
  • 30
  • 61
0
votes
1 answer

Uncaught Error: Class "GuzzleHttp\Promise\EachPromise"

I tried implementing the below code but it is showing the EachPromise Error class not found and Promise Error class not found. Guzzle library is installed. Then also this error was there.
Sheldon
  • 11
  • 1
0
votes
1 answer

Guzzle Get request with headers and query string

I'm trying to fetch data by GET request with using Guzzle client. I'm using both header with JWT token and query params like below: function fetchUserByEmployeeId(string $employeeId): JsonResponse { $headers = $this->getHeaders(); …
Krzysztof Michalski
  • 791
  • 1
  • 9
  • 25
0
votes
0 answers

Zendesk API: Receiving 422 response with "Email: cannot be blank"

when using postman, everything works fine as per screenshot below: Once guzzle client is used, for the same payload (visible in screenshot below), there is this error message "email cannot be blank": In the documentation, I don't see anything…
1 2 3
99
100