Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save napolux/dbce7ab17005c7ca0dcdd0ff750736e7 to your computer and use it in GitHub Desktop.
Save napolux/dbce7ab17005c7ca0dcdd0ff750736e7 to your computer and use it in GitHub Desktop.
cURL POST example
curl http://w3.org/ -d "hello=world&foo=bar" --trace-ascii /dev/stdout
== Info: Trying 128.30.52.45...
== Info: Connected to w3.org (128.30.52.45) port 80 (#0)
=> Send header, 140 bytes (0x8c)
0000: POST / HTTP/1.1
0011: Host: w3.org
001f: User-Agent: curl/7.43.0
0038: Accept: */*
0045: Content-Length: 19
0059: Content-Type: application/x-www-form-urlencoded
008a:
=> Send data, 19 bytes (0x13)
0000: hello=world&foo=bar
== Info: upload completely sent off: 19 out of 19 bytes
<= Recv header, 32 bytes (0x20)
0000: HTTP/1.1 301 Moved Permanently
<= Recv header, 19 bytes (0x13)
0000: Content-length: 0
<= Recv header, 30 bytes (0x1e)
0000: Location: http://www.w3.org/
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv header, 2 bytes (0x2)
0000:
== Info: Closing connection 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment