Having trouble with a curl POST request? Need help sending data correctly? Alternatively: How do I pr

14 Replies, 1542 Views

Dude, escaping quotes in JSON for curl post requests is the worst. On Linux/macOS, single quotes around the JSON work fine. On Windows, you might need to use double quotes and escape the inner ones with backslashes.

Also, if the server rejects it, try `-H "Accept: application/json"` alongside the Content-Type header. Some APIs are picky.

For hanging requests, maybe a timeout issue? Add `--connect-timeout 10` to bail after 10 seconds.

Messages In This Thread



Users browsing this thread: 1 Guest(s)