curl
A command-line tool for sending web requests and printing the response.
In more detail
Flags such as -i (show response headers), -H (add a header) and -X (choose the method) let you build and inspect any request from a terminal. In scripts, -s hides the progress meter and -f makes curl fail on HTTP error codes instead of saving the error page.
Examples
In the APIs course: The course uses curl to show whole exchanges: -s hides the progress bar, -i prints the status line and headers, -I sends a HEAD request, -H adds a header and --json sends a JSON body.curl -si localhost:8765/tasks/1curl -si -H 'If-None-Match: "1"' localhost:8765/tasks/1curl -fsS https://example.com/status.json -o status.jsoncurl -sS -H "authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com"kubectl run smoke --rm -it --image=curlimages/curl -- curl webcurl -s http://localhost:18080/healthcurl -i http://localhost:3000/api/healthcurl -N http://localhost:3000/api/chatcurl -s localhost:8000/metrics | grep http_requests_totalauditd records curl fetching a file into a hidden name in /tmp.CVE-2023-38545 in curl appears in two scanners' rows for the same imageRelated terms
- HTTP request — The message a client sends to a server: a method, a target, a protocol version, headers, a blank line and an optional body.
- HTTP response — The message a server sends back: a protocol version, a status code and phrase, headers, a blank line and usually a body.
- HEAD — The HTTP method that asks for exactly the headers a GET would return, but without the body.
- HTTP — The protocol web browsers and web servers use to send requests and responses.
- wget — A command that downloads files from web servers, saving them to disk by default.
- URL — A web address, such as https://example.com/docs, made of a scheme, a host, an optional port and a path.
- bearer token — A token that grants access to whoever presents it, sent as Authorization: Bearer <token>, without any further proof of identity.
- health endpoint — A web address, often /health, that a service answers quickly to show it is up.
- endpoint — An address that a program sends requests to, such as a web path like /health or a network socket.
- Prometheus HTTP API — The web interface Prometheus offers for running queries and inspecting targets, used by Grafana and by scripts.
- CVE — A public identifier, such as CVE-2024-21626, given to one known security vulnerability so everyone can refer to it.
- base image — The image a Dockerfile starts from with FROM, which supplies the operating system files and often a language runtime.
Taught in
- What An API Is, And The Alternatives — Modern API Architecture: REST, GraphQL & gRPC
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC
- Headers And Content Negotiation — Modern API Architecture: REST, GraphQL & gRPC
- Caching And Conditional Requests — Modern API Architecture: REST, GraphQL & gRPC
- Cookies And CORS — Modern API Architecture: REST, GraphQL & gRPC
- Archives, Transfers And The Network — Bash Scripting & Command Line Automation
- Keyless Authentication: OIDC to the Cloud — Continuous Integration & Continuous Delivery Pipelines
- Spend Two Hours Like A Points Table — Certified Kubernetes Administrator (CKA) Exam Prep
- Two Hours, Twenty Tasks: Exam Strategy — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Debugging Applications In Kubernetes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Observability: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Services And Networking: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Final Review: Where Your Marks Are At Risk — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Six Seconds, Every Secret — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Two Hours, Sixteen Tasks: A CKS Plan — Certified Kubernetes Security Specialist (CKS) Exam Prep
- The Metadata Endpoint And The Kubelet's Front Door — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Ingress TLS: When The Padlock Lies — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Minimal Base Images: Less To Attack — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Falco: Detecting What Happens Inside Containers — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Immutable Containers: Read-Only At Runtime — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Container Hardening: Distroless & Rootless — Cloud Security & DevSecOps Engineering
- Install Docker And Verify Your Environment — Docker Architecture & Production Containers
- Commands, Logs, Exec And Exit Codes — Docker Architecture & Production Containers
- Run The Spine Service And Publish Its Port — Docker Architecture & Production Containers
- ARG, ENV, LABEL, EXPOSE And VOLUME — Docker Architecture & Production Containers
- Authenticate, Tag, Push And Pull From A Registry — Docker Architecture & Production Containers
- Ephemeral Filesystems And Named Volumes — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers
- Port Publishing, Localhost And Network Troubleshooting — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Define The Service And Database With Compose — Docker Architecture & Production Containers
- Health Checks, Dependencies And Reliable Startup — Docker Architecture & Production Containers
- Development Overrides, Hot Reloading And Debuggers — Docker Architecture & Production Containers
- Build, Test And Promote The Same Image In CI — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- Comparing Controllers and Minimal APIs — Modern .NET Core, C# & Enterprise Microservices
- OpenAPI Generation in .NET 9 — Modern .NET Core, C# & Enterprise Microservices
- API Documentation UI with Scalar — Modern .NET Core, C# & Enterprise Microservices
- Troubleshooting: A Timed Service Recovery Drill — Kubernetes: Production-Grade Container Orchestration
- Route Handlers: RESTful Endpoints with NextRequest — Next.js 15 & Modern App Router Architecture
- Observability Versus Monitoring — Full-Stack Observability: Metrics, Tracing & Logging
- The Three Signals: Logs, Metrics And Traces — Full-Stack Observability: Metrics, Tracing & Logging
- Prometheus Scraping And The Pull Model — Full-Stack Observability: Metrics, Tracing & Logging
- The Prometheus Exposition Format — Full-Stack Observability: Metrics, Tracing & Logging
- Grafana: Connecting The Data Source — Full-Stack Observability: Metrics, Tracing & Logging
- Milliseconds Versus Seconds: Naming Metrics And Labels — Prometheus Certified Associate (PCA) Exam Prep
- Windows Event Logs, Sysmon & Linux Auditd Telemetry — Security Operations & Threat Hunting (SOC)
- Container Security: Minimal Bases And Non Root — Application Security & Threat Modeling for Engineers
- How To Stop Drowning In Findings — Application Security & Threat Modeling for Engineers