Difference between revisions of "CURL"

From wikieduonline
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{lowercase title}}  
 
{{lowercase title}}  
[[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.
+
[[wikipedia:CURL|cURL]] ([[1996]]) <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.
  
 
  [[brew install curl]]
 
  [[brew install curl]]
Line 53: Line 53:
 
* <code>[[curl: (52) Empty reply from server]]</code>
 
* <code>[[curl: (52) Empty reply from server]]</code>
 
* <code>[[CURL Error (7): couldn't connect to host]]</code>
 
* <code>[[CURL Error (7): couldn't connect to host]]</code>
 +
* <code>[[curl: (35) OpenSSL SSL connect: SSL ERROR SYSCALL in connection to]]</code>
 +
* <code>[[curl: (47) Maximum (50) redirects followed]]</code>
  
 
== Related terms ==
 
== Related terms ==
Line 61: Line 63:
 
* [[Scraping]]
 
* [[Scraping]]
 
* <code>[[get_url]]</code> [[ansible]]
 
* <code>[[get_url]]</code> [[ansible]]
 +
* [[kubectl run -it --rm]] test --image=[[curlimages/curl]] --restart=Never [[--]] [[/bin/sh]]
  
 
== See also ==
 
== See also ==

Latest revision as of 08:48, 23 February 2024

cURL (1996) [1] 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.

brew install curl
apt install curl

Examples[edit]

-s --silent Avoid showing progress bar
-S --show-error
-L, --location follow redirects
curl --user user:pass --cookie-jar ./somefile_with_your_cookies https://xyz.com/a
curl --cookie ./omefile_with_your_cookiese https://xyz.com/b
  • Upload a file:
curl -u YOUR_USERNAME:YOUR_PASSWORD -T FILE_TO_UPLOAD https://yourpasswordprotectedpage.com/your_destionation
-T, --upload-file <file>
curl -sD - -o /dev/null http://example.com[3]
-s Avoid showing progress bar
-D Dump headers to a file, but - sends it to stdout
-o /dev/null Ignore response body


Offers the same features to fetch remote banner information from HTTP servers:

curl -s -I 192.168.0.15 | grep -e "Server: "

Other options:

-k, --insecure To accept self signed certificate
-L, --location

Advance usage[edit]

curl -o /dev/null -s -w 'Total: %{time_total}s\n' https://www.google.com

Errors[edit]

Related terms[edit]

See also[edit]

  • http://man7.org/linux/man-pages/man1/curl.1.html
  • https://docs.gitlab.com/ee/api/notification_settings.html#global-notification-settings
  • https://stackoverflow.com/questions/3252851/how-to-display-request-headers-with-command-line-curl
  • Advertising: