curl Cheat Sheet: Essential Flags for Requests, Debugging and Shell Pitfalls
curl, the HTTP client preinstalled on most machines, CI runners, Docker images and servers, is the tool API documentation typically uses to show requests. The guide highlights three core flags, -X for method, -H for headers and -d for body, and notes that -d defaults to form encoding, so JSON requires an explicit Content-Type header. It recommends -G with --data-urlencode for safe query strings, and since curl 7.82 the --json option, which sets the needed headers automatically. It also distinguishes -F multipart uploads from raw -d file bodies, covers common authentication and cookie methods, and explains diagnostic flags such as -i, -v, -w, -L and --fail.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in