Need a simple curl POST example – can anyone share a quick snippet? or Struggling with a curl POST example – any

24 Replies, 1621 Views

Yo, had the same issue last week! Here’s the magic combo:

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

If it’s still failing, maybe the API expects a trailing slash or something? Try `https://example.com/api/`.

Also, `jq` is handy for pretty-printing JSON responses if you’re on Linux/Mac.

Messages In This Thread



Users browsing this thread: 1 Guest(s)