The cURL flags you actually need, how to read status codes and headers, sending JSON bodies and auth, and moving requests between cURL and a GUI client.
Almost every API reference, browser DevTools panel and support ticket can express a request as a cURL command. That makes cURL the shared format for reproducing a problem: if you can send it with cURL, anyone on your team can run exactly the same request and see the same response.
Browsers can copy any network request as cURL (right-click the request in the Network panel, then Copy as cURL). That is the quickest way to replay a failing front-end call outside the app and isolate whether the bug is in the client or the server.
-X sets the method (GET is the default; -d implies POST). -H adds a header and can be repeated. -d or --data sends a body; --data-raw sends it without interpreting @ as a file reference. -i includes response headers in the output, -v shows the full exchange including TLS and request headers, and -s silences the progress bar. -L follows redirects, which cURL does not do by default.
For JSON APIs the most common pattern is: curl -s -X POST https://api.example.com/items -H "Content-Type: application/json" -d '{"name":"test"}'. Forgetting the Content-Type header is a frequent cause of 400 or 415 errors, because cURL sends -d bodies as application/x-www-form-urlencoded unless told otherwise.
Start with the status code. 2xx means success. 3xx is a redirect; add -L or check the Location header. 400 means the server could not parse or validate the request, so compare the body with the API's schema. 401 means missing or invalid credentials, while 403 means the credentials are valid but lack permission. 404 can mean a wrong path or a resource the caller is not allowed to know exists. 429 is rate limiting; look for a Retry-After header. 5xx is a server-side failure worth reporting with the exact request.
Headers often explain more than the body: Content-Type tells you how to parse the response, WWW-Authenticate explains what auth the server expects, and request IDs (often X-Request-Id) let the API provider find your request in their logs.
Bearer tokens go in a header: -H "Authorization: Bearer <token>". Basic auth can be written as -u user:password, which cURL encodes for you. API keys are passed either as a header (commonly X-API-Key) or a query parameter, depending on the provider.
Be careful with secrets on the command line: they end up in your shell history and can be visible to other users through the process list. Read them from an environment variable (-H "Authorization: Bearer $API_TOKEN") and redact tokens before sharing a command in a ticket or chat.
A request that works in cURL can fail in a browser-based client with a CORS error. cURL does not enforce the same-origin policy; browsers do. The server must return Access-Control-Allow-Origin (and, for non-simple requests, answer the preflight OPTIONS request) before the browser will expose the response to the page.
If an API is not configured for browser access, a browser-based client cannot reach it directly, and that is a server configuration issue rather than a bug in the request. In that case use cURL, or test against an endpoint that allows your origin.
GUI clients are easier for iterating on headers and bodies, comparing responses and keeping a history. cURL is easier to share, script and paste into documentation. A good workflow uses both: import a cURL command into a client to tweak it, then export the working request back to cURL for the bug report or the README.
When you share the final command, remove cookies and tokens that were captured from your browser session, and replace production hosts with staging where possible.