Having trouble with curl sending JSON? Need help troubleshooting!

18 Replies, 1599 Views

Hey! I had the same issue with curl sending JSON a while back. Turns out, the API I was using expected the JSON to be minified (no spaces or line breaks). Try this:

```bash
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://example.com/api
```

Also, check if the API requires any additional headers like `Authorization`. Sometimes that’s the missing piece.

Messages In This Thread



Users browsing this thread: 1 Guest(s)