Operating Systems

A technician must check which HTTP status code https://app.example.com returns, from a Linux terminal and without downloading the page body. Which command should be used?

Show the answer

Correct answerA. curl -I https://app.example.com

AWhy this is right: curl -I sends an HTTP request and prints only the response headers, including the status code.

BWhy not this: ping tests ICMP reachability; a host can answer ping while the web service returns errors.

CWhy not this: dig returns DNS records for the name, not anything from the web server's HTTP response.

DWhy not this: traceroute lists router hops to the host and does not make an HTTP request.

curl -I requests only the HTTP response headers, which include the status code. ping only shows that the host answers ICMP, which says nothing about what the web service returns.