oliverdavies.uk/source/_posts/16.md
Oliver Davies 2c517f1d39 Move zet notes to blog posts
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
2025-09-10 18:36:36 +01:00

781 B

title date tags links note permalink
Sending POST requests with curl 2024-08-27 20:11:37
Linux
Command-Line
curl
https://stackoverflow.com/questions/7172784/how-do-i-post-json-data-with-curl
https://linuxize.com/post/curl-post-request
true /notes/16-sending-post-requests-with-curl
curl --header "Content-Type: application/json" \
  --insecure \
  --data '{"foo": "bar"}' \
  https://example.docker.localhost/webhook

--request POST is implied if --data is passed.

--insecure skips SSL validation, e.g. if using a self-signed certificate.

Also, from man curl:

--json works as a shortcut for passing on these three options:

--data [arg]
--header "Content-Type: application/json"
--header "Accept: application/json"