Difference between revisions of "BASH curl"

From Indie IT Wiki
imported>Indieit
 
Line 1: Line 1:
 
== '''HOWTO:'''==
 
== '''HOWTO:'''==
 +
 +
=== HTML Tidy ===
 +
 +
curl https://www.paully.co.uk/ | tidy -wrap 0 -quiet -omit
  
 
=== Computer's Eternal IP Address ===
 
=== Computer's Eternal IP Address ===

Revision as of 10:56, 17 June 2023

HOWTO:

HTML Tidy

curl https://www.paully.co.uk/ | tidy -wrap 0 -quiet -omit

Computer's Eternal IP Address

curl ifconfig.me

Geographical Information Based On IP Address

curl ipinfo.io

Output:

{
 "ip": "xxx.xxx.xxx.xxx",
 "hostname": "username.isp.com",
 "city": "xxxxxx",
 "region": "xxxxxx",
 "country": "xx",
 "loc": "longitude, latitude",
 "org": "xxxxxx",
 "postal": "xxxxxx"
}

Web Page Headers

Terminal:~$

curl -I www.bbc.co.uk

Sample output...

HTTP/1.1 200 OK
Server: Apache
Content-Type: text/html
Content-Language: en-GB
Etag: "4c572592f520bedc9a1e2c0238accaa6"
X-PAL-Host: pal041.back.live.cwwtf.local:80
Transfer-Encoding: chunked
Date: Fri, 06 Mar 2015 11:30:51 GMT
Connection: keep-alive
Set-Cookie: BBC-UID=15d4ff99887f5eab78a60516b12f651317b26b71e7f4e4a61ad0970254e467200curl/7.35.0; expires=Tue, 05-Mar-19 11:30:51 GMT; path=/; domain=.bbc.co.uk
X-Cache-Action: HIT
X-Cache-Hits: 1149
X-Cache-Age: 64
Cache-Control: private, max-age=0, must-revalidate
Vary: X-CDN

Thanks to CyberCiti.