How Do I Properly Use CURL --POST to Send Data in a Request? or What’s the Correct Syntax for CURL --

20 Replies, 1448 Views

Dude, CURL --POST with JSON is fussy. You need:
`curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"stuff":"here"}' http://example.com`

Some APIs are picky about the `Accept` header too.

For form data, `-d` is fine, but if you’re uploading files, use `-F` instead.

Messages In This Thread



Users browsing this thread: 1 Guest(s)