Overview Tooling
Tooling: curl
c 2020-03-10 | m | r 1
Links
curl or wget?
Curl or wget are similar tools, both can be do almost te same. But to keep it simple:
- curl is optimized for
calling APIsor crawl a website. - wget is better for
downloading web content.
Command Line Options (overview)
| Short | Long | Description |
|---|---|---|
| -# | –progress-bar | Show a progress bar |
| -u | –user | Username and plaintext password in user:password notation |
| -b | –cookie | Use cookie with request |
| -c | –cookie-jar | Save cookie to file |
| -H | –header | Headers to add to the request |
| -i | –include | Include HTTP headers in the output |
| -I | –head | Fetch headers only |
| -k | –insecure | Allow insecure connections |
| -X | –request | Request method to use for the HTTP server communication |
| -o | –output | Write output to file |
| -O | remote-name | Write output to file named like the remote fil |
| -s | –silent Silent | Silent or quiet mode. Less or no output |
| -v | –verbose | Detailed information (useful for debugging, error handling) |
Request Types
- -X GET (default)
- -X POST
- -X PUT
- -X DELETE
Headers
- -H “Content-Type: application/x-www-form-urlencoded”
- -H “Content-Type: application/json”
Examples
Download the landing page of kargware.com and save it as index.html
curl -o index.html https://www.kargware.com