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

16 Replies, 1155 Views

Hey folks!

Struggling with curl --post here... can't seem to get it right.

Trying to send some JSON data, but the server keeps yelling at me.

Is the syntax like:
`curl --post -H "Content-Type: application/json" -d '{"key":"value"}' http://example.com`

Or am I missing something?

Also, when shoudl I even use curl --post? Like, is it just for APIs or what?

Pls halp, my terminal is judging me rn.

P.S. Why does it sometimes fail silently? So annoying.

Thanks!

Messages In This Thread
How do I properly use curl --post to send data in a request? or What's the correct syntax for curl -- - by - 13-06-2024, 09:19 PM



Users browsing this thread: 1 Guest(s)