[b]"How do I properly format a POST in cURL? Need help with syntax!"[/b] or [b]"What's the correct way to send a P

16 Replies, 788 Views

For JSON data, you gotta escape the quotes properly in some shells. Try:

```
curl -X POST https://example.com/api \
-H "Content-Type: application/json" \
-d "{\"key\":\"value\"}"
```

Or just use a file with `-d @data.json`. Way cleaner!

Messages In This Thread



Users browsing this thread: 1 Guest(s)