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

16 Replies, 1165 Views

Wait, why even use curl --post (I mean `-X POST`) manually?

If you’re doing a lot of API stuff, check out `httpie`—way simpler syntax.

But for your case:
```
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' http://example.com
```

And yeah, silent fails are the worst. `-v` or GTFO.

Messages In This Thread



Users browsing this thread: 1 Guest(s)