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

18 Replies, 1039 Views

Here’s a foolproof curl post example:

```
curl -X POST https://example.com/api \
-H 'Content-Type: application/json' \
-d '{"field1":"value1", "field2":"value2"}'
```

Bonus: Use `jq` to prettify JSON responses like this:

```
curl ... | jq
```

If you’re stuck, paste your error—we’ll figure it out!

Messages In This Thread



Users browsing this thread: 1 Guest(s)