http

http troubleshooting with curly

http

 -H | --http            HTTP actions ....
    |                   response: print response header of server
    |                   redirect: check if redirect id done or not
    |                   status: print status for the GET request
    |                   ttfb: print statistics about Time to First Byte
    |                   gzip: check if gzip is enabled or not

actions for HTTP

  • response (or res)

  • redirect (or red)

  • status

  • ttfb (= Time to First Byte)

  • gzip

response

check the response form the server

root[0]shakiba:/pp# curly --http res -d media.shakiba.net
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 10 Nov 2020 12:33:44 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: https://media.shakiba.net/

HTTP/2 200
server: nginx/1.14.0 (Ubuntu)
date: Tue, 10 Nov 2020 12:33:44 GMT
content-type: text/html


option: http
action: response
status: OK

exit 0
root[0]shakiba:/pp#

redirect

check redirection of a domain

root[0]shakiba:/pp# curly --http red -d media.shakiba.net
HTTP/1.1 301 Moved Permanently
Location: https://media.shakiba.net/
HTTP/2 200

option: http
action: redirect
status: OK

exit 0
root[0]shakiba:/pp#

status

check status of the servers and more

root[0]shakiba:/pp# curly --http status -d media.shakiba.net
URL               https://media.shakiba.net/
status            200
remote_ip         185.8.172.233
remote_port       443
num_connects      2
num_redirects     1
scheme            HTTPS
http_version      2
ssl_verify_result 0

option: http
action: status
status: OK

exit 0
root[0]shakiba:/pp#

ttfb

measure Time to First Byte

root[0]shakiba:/pp# curly --http ttfb -d media.shakiba.net
url_effective       https://media.shakiba.net/
time_namelookupe    0.012499 | DNS lookup
time_connect        0.013454 | TCP connection
time_appconnect     0.049755 | App connection
time_redirect       0.005649 | Redirection time
time_starttransfer  0.057018 | TTFB
time_total          0.058207

option: http
action: ttfb
status: OK

exit 0
root[0]shakiba:/pp#

gzip

check if gzip has been enabled or not

root[0]shakiba:/pp# curly --http gzip -d media.shakiba.net
         compressed        uncompressed  ratio uncompressed_name
               1173                3591  67.8% /tmp/curl
gzip is enabled

option: http
action: gzip
status: OK

exit 0
root[0]shakiba:/pp#

Last updated

Was this helpful?