How to Use CURL GET info from POST Request – Is It Possible? or Can You Retrieve CURL GET info from P

20 Replies, 2041 Views

Honestly, unless you’re dealing with legacy code, avoid this mess. Redesign the endpoint to use POST body or GET params, not both.

But if you’re stuck, `parse_str(file_get_contents('php://input'), $postData)` might help fish out params.

---

OP Reply:

Wow, thanks for all the replies! Didn’t expect so many ideas.

Tried the `$_SERVER['QUERY_STRING']` trick and it kinda worked—found some stray GET params hiding there. Still feels janky though.

Might just refactor the endpoint like a few of you suggested. Appreciate the sanity check!

Quick follow-up: anyone know if this "CURL GET info from POST request" hack breaks with HTTPS or custom headers? Just wanna cover my bases.

Cheers!

Messages In This Thread



Users browsing this thread: 1 Guest(s)