-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
088922a
commit 9f8317d
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# curl | ||
|
||
> Transfers data from or to a server. | ||
> Supports most protocols, including HTTP, FTP, and POP3. | ||
|
||
- Download the contents of an URL to a file: | ||
|
||
`curl {{http://example.com}} -o {{filename}}` | ||
|
||
- Download a file, saving the output under the filename indicated by the URL: | ||
|
||
`curl -O {{http://example.com/filename}}` | ||
|
||
- Download a file, following [L]ocation redirects, and automatically [C]ontinuing (resuming) a previous file transfer: | ||
|
||
`curl -O -L -C - {{http://example.com/filename}}` | ||
|
||
- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`): | ||
|
||
`curl -d {{'name=bob'}} {{http://example.com/form}}` | ||
|
||
- Send a request with an extra header, using a custom HTTP method: | ||
|
||
`curl -H {{'X-My-Header: 123'}} -X {{PUT}} {{http://example.com}}` | ||
|
||
- Send data in JSON format, specifying the appropriate content-type header: | ||
|
||
`curl -d {{'{"name":"bob"}'}} -H {{'Content-Type: application/json'}} {{http://example.com/users/1234}}` | ||
|
||
- Pass a user name and password for server authentication: | ||
|
||
`curl -u myusername:mypassword {{http://example.com}}` | ||
|
||
- Pass client certificate and key for a resource, skipping certificate validation: | ||
|
||
`curl --cert {{client.pem}} --key {{key.pem}} --insecure {{https://example.com}}` |