Man, I used to mess up how to curl with data all the time. Here’s my cheat sheet:
- JSON: `curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL`
- Form: `curl -d "key=value" URL` or `--data-urlencode` for safety.
Also, `-v` flag helps debug when things go sideways.
- JSON: `curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL`
- Form: `curl -d "key=value" URL` or `--data-urlencode` for safety.
Also, `-v` flag helps debug when things go sideways.
