Having trouble with a curl POST request? Need help sending data correctly? Alternatively: How do I pr

14 Replies, 1549 Views

Wow, thanks for all the tips! The `-v` flag helped me see the server was returning a 401—turns out I forgot the auth header. D’oh!

Still getting a weird error when sending nested JSON though. Like:
```bash
curl -X POST https://example.com/api \
-H "Content-Type: application/json" \
-d '{"user": {"name": "test", "id": 123}}'
```

Server says "invalid format." Is there a way to log the raw request body to see if curl is mangling it?

Also, httpbin.org/post is a lifesaver—thanks for that!

Messages In This Thread



Users browsing this thread: 1 Guest(s)