Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Forrest's avatar

Post request using guzzleHttp

Hi everyone, I have a problem with sending post request to an API using guzzleHttp. I'm getting an error

	Client error: `POST https://h2.incocloud.com/connect/api/restaurant_order_request` resulted in a `404 Not Found` response:\n{\"Message\":\"No HTTP resource was found that matches the request URI 'https://localhost/connect/api/restaurant_order_requ (truncated...)\n",

Here's my code:

			$client = new Client(['base_uri' => "https://h2.incocloud.com/connect/api/", 'headers' => [ 'Content-Type' => 'application/json' ]]);		
   			$response = $client->request('POST', 'restaurant_order_request', ['form_params' => ['token' => $this->accessToken, 'restaurantOrderRequest' => $data])->getBody(); 

Maybe you could help me to find out I am getting this error?

0 likes
3 replies
Forrest's avatar

@Sinnbeck Thank you for the reply. The base url is correct since it works with other endpoints. The problem may be with this specific endpoint "restaurant_order_request" . I wonder why am I getting the error. Where did localhost come from in the URI?

No HTTP resource was found that matches the request URI 'https://localhost/connect/api/restaurant_order_request'

Sinnbeck's avatar

@Forrest Hard to say. Is there no documentation for it? Can you try connecting to it using postman or similar and see if that gives a similar error?

Please or to participate in this conversation.