How do I properly use curl --post to send data in a request? or What's the correct syntax for curl --

19 Replies, 2361 Views

Ohhh, that makes so much sense now! Thanks, everyone—didn’t realize curl --post wasn’t a thing.

Tried the `-d` flag with JSON and it worked like a charm:
`curl -H "Content-Type: application/json" -d '{"name":"foo"}' https://example.com`

Quick follow-up: What’s the best way to handle auth headers with curl? Like, if I need to add a token?

Also, shoutout to the Postman suggestion—def gonna check that out.

Messages In This Thread



Users browsing this thread: 1 Guest(s)