Having trouble with a curl POST request? Need help sending data correctly? Alternatively: How do I pr

14 Replies, 1544 Views

Quick tip: If your curl post request hangs, it might be a SSL/TLS issue. Try adding `-k` to skip cert verification (for testing only!).

For JSON, yeah, always use `-H "Content-Type: application/json"`. And if you’re on Windows, use double quotes for the JSON and escape the inner ones like this:
```bash
curl -X POST https://example.com/api -H "Content-Type: application/json" -d "{\"key\":\"value\"}"
```

Also, `jq` is awesome for pretty-printing JSON responses.

Messages In This Thread



Users browsing this thread: 1 Guest(s)