Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save peacefixation/0e476e05f6c88579f012e47c746e1706 to your computer and use it in GitHub Desktop.
Save peacefixation/0e476e05f6c88579f012e47c746e1706 to your computer and use it in GitHub Desktop.
Curl POST request with JSON payload
curl -X POST -H "Content-Type: application/json" -d @data.json http://localhost:8000/endpoint
curl -X POST -H "Content-Type: application/json" -d @ '{"key1": "value1", "key2": "value2"}' http://localhost:8000/endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment