Having trouble with curl sending JSON? Need help troubleshooting!

18 Replies, 1600 Views

Hey everyone,

So I’m trying to use curl sending JSON to an API, but it’s just not working. I’ve been banging my head against the wall for hours now.

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

But I keep getting a 400 error. Am I missing something obvious?

Also, does the JSON need to be formatted in a specific way? I’ve tried escaping quotes and stuff, but no luck.

Anyone else run into issues with curl sending JSON? Any tips or tricks would be super helpful!

Thanks in advance!

Messages In This Thread
Having trouble with curl sending JSON? Need help troubleshooting! - by - 01-12-2024, 01:20 PM



Users browsing this thread: 1 Guest(s)