220-1102 Question 256
Single answercurlA help desk technician is troubleshooting whether a Linux workstation can reach an internal software repository at https://repo.corp.example.com. The technician wants to test only the HTTP response headers first, without downloading the full page content, so they can quickly verify that the server is reachable and responding. Which command should the technician use?
- A
curl -I https://repo.corp.example.com
- B
curl -O https://repo.corp.example.com
- C
curl -d https://repo.corp.example.com
- D
curl -X DELETE https://repo.corp.example.com
Show answer and explanation
Correct answer: A
Explanation
For this scenario, the best choice is curl -I because it performs a header-only request, which is a practical way to confirm that a web service is reachable and responding. This is commonly used by technicians during connectivity and web service troubleshooting because it is faster and less disruptive than downloading the full resource. By contrast, -O downloads the content, -d sends request data, and -X DELETE changes the HTTP method to one that could be unsafe in a production environment. According to curl documentation, -I/--head fetches the headers only, making it the appropriate choice when verifying HTTP status and response headers during diagnostics.
- A. Correct.
Correct. The -I option tells curl to fetch only the HTTP headers using a HEAD request. This is useful for quickly confirming connectivity and checking the server's response status without downloading the body of the page or file.
- B. Incorrect.
Incorrect. The -O option tells curl to download the resource and save it using the remote filename. This does not limit the request to headers only, so it would download content rather than just verifying the response headers.
- C. Incorrect.
Incorrect. The -d option is used to send data in the request body, typically for an HTTP POST request. It is not used to retrieve only headers, and using it this way would not match the technician's goal.
- D. Incorrect.
Incorrect. The -X DELETE option forces curl to use the HTTP DELETE method. That method is intended to request deletion of a resource and is not appropriate for safely testing whether a repository is reachable.