How do I properly send a POST request in cURL? or What's the correct way to make a POST request in cU

18 Replies, 1340 Views

Not sure if this helps, but I always use `-L` to follow redirects in case the API moves stuff around. For a post request in curl, here’s what works for me:

```
curl -L -X POST https://example.com/api \
-H "Content-Type: application/json" \
-d '{"data":"stuff"}'
```

If you’re still stuck, try `curl --help` or check out the man page. It’s a lifesaver.

Messages In This Thread



Users browsing this thread: 1 Guest(s)