Living in the Shell #16; curl (HTTP/S Client) (Part 1)

Living in the Shell #16; curl (HTTP/S Client) (Part 1)

Dec 15, 2021ยท

1 min read

curl ๐ŸŒ

Makes requests in various protocols, including (but not limited to) HTTP/HTTPS/FTP/FTPS.

Make a simple GET request

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<H1>301 Moved</H1>
The document has moved
<A HREF="">here</A>.

Simple GET request with following redirects -L

curl -L

Write response to a file -o

curl -L -o content.html

Include response headers -i

curl -i -L
HTTP/2 301 
content-type: text/html; charset=UTF-8
date: Wed, 15 Dec 2021 17:45:16 GMT
expires: Fri, 14 Jan 2022 17:45:16 GMT
cache-control: public, max-age=2592000
server: gws
content-length: 220
x-xss-protection: 0
x-frame-options: SAMEORIGIN

Request via a HTTP proxy server -x

curl -L -x proxy-server:port

Request via a SOCKS proxy server --socks

curl -L --socks proxy-server:port