A Programmable Client
A browser hides what really happens on an HTTP request. The curl tool lets you send a request by hand and see the full exchange, which makes it ideal for debugging web services and APIs.
What It Reveals
Curl exposes details a browser conceals.
- Verbose mode prints the request and response headers line by line.
- You can set the method, headers, and body to test an API precisely.
- A timing breakdown shows where seconds go, from DNS to connect to first byte.
This lets you separate a slow name lookup from a slow connection from a slow server.
Common Investigations
You can confirm a redirect chain, check which status code an endpoint returns, or send a custom header to reproduce a bug. Resolving a host to a specific address lets you bypass a load balancer and hit one backend. Because curl is scriptable, the same request can run in a loop to catch an intermittent failure.
Key idea
Curl drives HTTP by hand so you can see full headers, set the method and body, and read a timing breakdown that separates slow DNS from slow connect from a slow server.