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

agiledigital's avatar

Guzzle POST request hanging vs GET request

I'm experiencing a bizarre scenario. I'm calling an API endpoint from my Laravel app using Guzzle. A GET request sends back an instant response, where as a POST request hangs and then 504 gateway timeouts.

I've tested the same endpoints on both Postman and via the terminal and both GET and POST send back instant responses. I've cross checked that all the config matches, which it does.

The POST request from my app is correct and working as the API endpoint is receiving the POST request, updating what it needs to and sends back a response, but upon that response coming back is where it hangs.

The API endpoint URL contains reference to port 2025 - I thought I might need to open this port on my server for the response to come back but then if that was the case then the GET request wouldn't work either.

Has anyone experienced this or have any suggestions of what I could check or try out?

0 likes
3 replies
agiledigital's avatar

I seem to have resolved it to an extent - it seems to be an issue with Guzzle, and whilst at the time of writing I don't know what the exact problem is, it worked when converting the request to a plain cURL request in my PHP code.

I'll leave this post up for anyone else coming across this issue and may be able to resolve.

Snapey's avatar

What are you using for a web server

martinbean's avatar

@agiledigital I think @snapey is going to allude to you’re using something like Sail, which uses the built-in PHP web server under the hood, which is single-threaded so therefore can only handle one request at a time.

Other than that, I’d also suggest writing actual tests instead of “testing” in Postman.

Please or to participate in this conversation.