How to properly use curl POST JSON in my API requests? or What's the correct syntax for a curl POST J

14 Replies, 1650 Views

OP here—wow, thanks everyone! The header was the issue, and escaping quotes in cmd *sucked*, but this worked:

```bash
curl -X POST https://api.example.com/data -H "Content-Type: application/json" -d "{\"name\":\"test\",\"value\":123}"
```

Still got a 401 though... do I need an API key in the headers too? Docs are vague.

Also, gonna try Postman like someone suggested. Cheers!

Messages In This Thread



Users browsing this thread: 1 Guest(s)