I need help with my code. I am trying to create a new store in Geoserver. public function post_store(String $name) { $client = new Client(); $res = $client->request('POST', 'http://localhost:8080/geoserver/rest/workspaces/&a ...
I'm currently sending a Guzzle request to an API, and $request = $this->client->request('GET', 'https://etc', ['http_errors' => false]); Due to the API responding with a JSON message along with a 402 header co ...
I'm currently working on a personal application project where I need to make requests to various websites using the Guzzle package. One specific requirement I have is to log every request in my database, including the time of the request, the duration, an ...
I am brand new to PHP and I am currently exploring how to call a REST Service. To achieve this, I have the option of using either Curl or Guzzle Client in PHP. After setting it up, I tested calling the service from Mozilla and Chrome Browsers. However, I ...
I am attempting to send 100 asynchronous requests to the Instagram website using PHP Guzzle as shown below: $client = new Client(); $promises = []; for($i = 1; $i <= 100; $i++) { $options = ['timeout' => 60]; $promise = $client-&g ...
I am currently facing an issue with my code, which involves making multiple calls to the same site using Guzzle in order to check for the existence of a document. Each call results in an increase in memory usage, eventually leading to memory exhaustion whe ...
In my project, I am generating multiple GuzzleHttpPsr7Requests as shown below: use GuzzleHttpPsr7Request; $myRequest = new Request( 'GET', $someUri ); All these requests are stored in an array called $guzzleRequests. To handle all the reque ...
Can anyone help me figure out how to send multiple data with a POST request? Here's what works: $data = array( 'post_params'=>[ 'Name'=>'Foo', 'LastName'=>'Bar' ] ); But when I try this, it doesn't work. Any suggestions? $data = array( 'pos ...
Looking to transition a method from GuzzleHttp to using a pool that implements the Request method. <?php use GuzzleHttp\Client; $params = ['password' => '123456']; $header = ['Accept' => 'application/xml&ap ...
Just starting out with guzzle and I need help on how to make a Guzzle call for this specific request. curl -X POST -u username:password -H "Content-Type: application/json" https://xyz/api/v1/accounts.json -d '{"user":{"username":"test","password":"xyz","f ...