An HTTP endpoint can fail in several distinct ways. Name resolution can fail, the TCP connection can time out, TLS verification can reject the certificate, a proxy can alter the request, the server can redirect to another host, or the application can return an error response.
curl exposes each stage from a terminal and gives precise control over the request. wget concentrates on retrieving files reliably, including interrupted and recursive downloads. Both tools support several protocols, but this chapter focuses on HTTP and HTTPS because they cover the main backend debugging and download workflows.
A short command can answer a useful first question:
A dependable diagnosis needs more control. The command should separate headers from content, set time limits, preserve the hostname while testing a specific server, handle HTTP errors deliberately, and avoid leaking credentials into logs.