A curl cheat sheet
daniel.haxx.se
daniel.haxx.se
$ curl ipinfo.io
{
"ip": "208.54.39.206",
"hostname": "mce2736d0.tmodns.net",
"city": "Los Angeles",
"region": "California",
"country": "US",
"loc": "34.0522,-118.2437",
"org": "AS21928 T-Mobile USA, Inc.",
"postal": "90013",
"phone": 213
}
Or just your IP $ curl ipinfo.io/ip
208.54.39.206
Or any other field (eg. city) $ curl ipinfo.io/city
Los Angeles
Or lookup another IP $ curl ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0838",
"org": "AS15169 Google Inc.",
"postal": "94040",
"phone": 650
}
Or a specific field for that IP: $ curl ipinfo.io/8.8.8.8/org
AS15169 Google Inc.Full-Disclosure: Some people still believe in it
or just use a fake account ... like anybody else :D
https://github.com/jkbrzt/httpie
No cheatsheeet needed, the syntax is a lot friendler.
curl's syntax is also baked into various Web Browser network debuggers. Both Chrome and Firefox's network transactions display have a "output to curl" option to allow you to recreate the network transaction exactly.
Edit: on Firefox, the option is "Copy as curl"
curl is better tool than wget but I used wget first and never changed. I do use aria2c more now for downloading but I know curl is a great tool I don't use.
http_proxy=http://proxy-server.example:3128/ some_command