Having trouble with a POST JSON cURL request? Need help troubleshooting or examples?

8 Replies, 1415 Views

Hey everyone,

Sooo, I’m trying to send a post JSON curl request, but it’s just not working for me. 😩 I’ve been staring at my terminal for hours, and I’m pretty sure I’m missing something obvious.

Here’s what I’m doing:
`curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' http://example.com/api`

But I keep getting errors like "400 Bad Request" or "invalid JSON." Am I formatting the JSON wrong? Or is it something with the headers?

If anyone’s got a working example of a post JSON curl request, pls share! Or if you’ve dealt with this before, any tips would be *chef’s kiss*.

Thanks in advance, y’all! 🙏

Messages In This Thread
Having trouble with a POST JSON cURL request? Need help troubleshooting or examples? - by - 16-06-2024, 04:48 AM



Users browsing this thread: 1 Guest(s)