How can I debug HTTP curl requests when the response is empty? or What's the best way to handle authe

18 Replies, 918 Views

Bro, you’re missing headers. Most APIs want `Accept: application/json` or `Content-Type: application/json`.

For JSON POSTs, do this:
`curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://example.com/api`

If it still fails, the API might need auth. Check their docs!

Messages In This Thread



Users browsing this thread: 1 Guest(s)