Editing CURL
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{lowercase title}} | {{lowercase title}} | ||
− | [[wikipedia:CURL|cURL]] | + | [[wikipedia:CURL (software)|cURL]]<ref>http://man7.org/linux/man-pages/man1/curl.1.html</ref> is a command-line tool for getting or sending data including files using URL syntax. cURL supports a range of common network protocols, currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DAP, DICT, TELNET, FILE, IMAP, POP3, SMTP and RTSP. |
− | |||
− | |||
− | == | + | == Basic Usage == |
− | |||
* <code>curl -vvv https://google.com</code> | * <code>curl -vvv https://google.com</code> | ||
− | |||
* <code>curl https://google.com/file_to_download -o output_file_name</code> | * <code>curl https://google.com/file_to_download -o output_file_name</code> | ||
* <code>curl -sS https://google.com</code> | * <code>curl -sS https://google.com</code> | ||
− | + | -s Avoid showing progress bar | |
− | |||
− | |||
− | |||
* <code>curl -u YOUR_USERNAME:YOUR_PASSWORD https://yourpasswordprotectedpage.com/</code> | * <code>curl -u YOUR_USERNAME:YOUR_PASSWORD https://yourpasswordprotectedpage.com/</code> | ||
* Save your cookies and reuse them: | * Save your cookies and reuse them: | ||
:<code>curl --user user:pass --cookie-jar ./somefile_with_your_cookies https://xyz.com/a</code> | :<code>curl --user user:pass --cookie-jar ./somefile_with_your_cookies https://xyz.com/a</code> | ||
:<code>curl --cookie ./omefile_with_your_cookiese https://xyz.com/b</code> | :<code>curl --cookie ./omefile_with_your_cookiese https://xyz.com/b</code> | ||
− | * <code> | + | *<code>curl --header 'X-JFrog-Art-Api: 1234567890'</code> |
− | * <code>curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/notification_settings</code><ref>https://docs.gitlab.com/ee/api/notification_settings.html#global-notification-settings</ref> | + | *<code>curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/notification_settings</code><ref>https://docs.gitlab.com/ee/api/notification_settings.html#global-notification-settings</ref> |
− | + | ||
− | |||
* Upload a file: | * Upload a file: | ||
− | + | curl -u YOUR_USERNAME:YOUR_PASSWORD -T FILE_TO_UPLOAD https://yourpasswordprotectedpage.com/your_destionation | |
− | + | -T, --upload-file <file> | |
* [[Display HTTP response headers]]: | * [[Display HTTP response headers]]: | ||
: <code>curl -sD - -o /dev/null http://example.com</code><ref>https://stackoverflow.com/questions/3252851/how-to-display-request-headers-with-command-line-curl</ref> | : <code>curl -sD - -o /dev/null http://example.com</code><ref>https://stackoverflow.com/questions/3252851/how-to-display-request-headers-with-command-line-curl</ref> | ||
− | + | -s Avoid showing progress bar | |
− | + | -D Dump headers to a file, but - sends it to stdout | |
− | + | -o /dev/null Ignore response body | |
− | * | + | * curl -XDELETE localhost:9200/index/type/documentID (Invoke-WebRequest -method DELETE http://localhost:9200/_all) |
Line 43: | Line 35: | ||
Other options: | Other options: | ||
− | -k, --insecure | + | -k, --insecure |
− | |||
== Advance usage== | == Advance usage== | ||
− | * Use cURL to measure request and response times: https://stackoverflow.com/a/22625150 | + | * Use cURL to measure request and response times: https://stackoverflow.com/a/22625150 |
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
* {{wget}} | * {{wget}} | ||
− | * | + | * [[Netcat]] |
+ | * [[wget]]: <code>wget -r http://example.com/</code> | ||
* <code>[[iwr]]</code> (Invoke-WebRequest) [[PowerShell]] functionality | * <code>[[iwr]]</code> (Invoke-WebRequest) [[PowerShell]] functionality | ||
− | * | + | * [[links (browser)]], [[lynx (browser)]], [[Elinks (browser)]] command line browsers |
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:Networking]] | [[Category:Networking]] |
Advertising: