How to curl post a URL with proper syntax and headers? or What’s the correct way to curl post a URL?

14 Replies, 805 Views

Pro tip: Use `jq` to format your JSON before curling. Helps spot syntax errors:

```
echo '{"key":"value"}' | jq .
```

Then curl post a url with the clean JSON.

Also, `-v` or `--trace-ascii debug.txt` will show you EXACTLY what’s being sent. Super handy for figuring out why the server’s unhappy.

Messages In This Thread



Users browsing this thread: 1 Guest(s)