12345678910111213141516171819202122232425262728293031323334353637 |
- % curl, http
- # send a get http request
- curl <url>
- # send a http request
- curl -X <method> <url>
- # send a http request and write the output to a file
- curl -X <method> <url> -o <filename>
- # send a get http request and follow redirects
- curl -L <url>
- # send a get http request exit with a non-zero status code on failure
- curl --fail <url>
- # send an authenticated http request
- curl -u <username>:<password> -X <method> <url>
- # send a http request with a json body
- curl -X <method> <url> -H 'Content-Type: application/json' -d '<json>'
- # send a http request with a form body
- curl <url> -d <bodykey>=<bodyvalue>
- # send a http request and see the request as well as the response
- curl -v <url>
- # send a http request with a body from a file
- curl -X <method> <url> --data-binary "@<file>"
- # send a http request with a custom header
- curl -X <method> <url> -H "<headername>: <headervalue>"
- $ file: ls
- $ method: echo -e 'GET\nPOST\nPUT\nDELETE\nPATCH'
|