Need a simple curl post example – how do I send data with curl? or Can someone share a basic curl pos

18 Replies, 1822 Views

Here’s a casual forum post for you:

---

Hey everyone!

I’m kinda stuck trying to figure out a *curl post example* for sending some data. Like, how do I even format this properly?

If I wanna send JSON, is it just:
```bash
curl -X POST https://example.com/api -H "Content-Type: application/json" -d '{"key":"value"}'
```
Or am I missing something?

Also, what if it’s form data instead? Like, do I use `-F` or still `-d`? A quick *curl post example* for both cases would be *so* helpful.

Thanks in advance! Y’all are lifesavers 🙏

---

Let me know if you want it tweaked! Kept it real and a bit messy, like an actual forum post.

Messages In This Thread
Need a simple curl post example – how do I send data with curl? or Can someone share a basic curl pos - by - 25-07-2024, 09:58 AM



Users browsing this thread: 1 Guest(s)