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

19 Replies, 2363 Views

Dude, curl --post doesn’t exist. You’re mixing flags. Use `-d` for data.

Example for form data:
`curl -d "name=foo&age=25" https://example.com`

For JSON, add the content-type header:
`curl -d '{"name":"foo"}' -H "Content-Type: application/json" https://example.com`

Pro tip: Use `curl --help` or check the man pages.

Messages In This Thread



Users browsing this thread: 1 Guest(s)