curl is the fasted command-line tool to see how a URI (uniform resource identifier) responds. You can send any kind of web request (GET, PATCH, POST, PUT).
To send a quick GET request, you simply pass curl the URL you want to send a GET request to.
It supports all kinds of protocols, including FTP, GOPHER, and various connection protocols like IMAP, SSH, SFTP, SMB, etc.
You’ll want to sit and read the manual page for curl. However, here are a few pointers to its options:
|–dns-servers||Instead of using your network connection’s default DNS servers, instead use alternative DNS servers specified after this flag. Helpful for debugging DNS propagation.|
|If you specify a -d or –data flag, the form will be submitted to the endpoint as a POST request with |
curl -d “name=abc” https://example.com
curl -d “name=abc” -https://example.com
curl -d @filename https://example.com
|Print ONLY the response headers; does not print the actual body of the response.|
|-T (or –upload-file)||Used to upload a local file to your remote endpoint.|
A note from the docs:
NOTE that you must use a
trailing / on the last directory to really prove to Curl
that there is no file name or curl will think that your
last directory name is the remote file name to use.
You can also use “globbing” here upload multiple files to a single URL by using the same, like this:
| -F (or ||Emulates what happens when a user submits a form. Specifically, sends the POST request with a request header of |