How do I properly use curl http post for sending data? or What's the correct syntax for a curl http p

16 Replies, 1766 Views

Wow, thanks everyone! The `-H "Content-Type: application/json"` tip worked—turns out the API was rejecting it without the header.

I also tried `-v` and saw a 400 error at first, but escaping the JSON fixed it.

Quick follow-up: how do I handle auth tokens in curl http post? Like, if the API needs `Authorization: Bearer token`?

(Also, httpie looks cool—gonna try that next!)

Messages In This Thread



Users browsing this thread: 1 Guest(s)