cURL & HTTP Terms in Java
Make HTTP requests from the terminal using cURL, understand HTTP methods, headers, request/response structure, and query parameters.
What is cURL
cURL is a command-line tool used to send HTTP requests directly from the terminal and inspect responses.
1. Definition of cURL
What cURL actually is.
2. Why Backend Developers Use cURL
Practical backend usage.
Using cURL
cURL can simulate almost any HTTP client behavior.
1. GET Requests
Fetching data.
2. POST Requests
Sending request body.
3. Debugging with cURL
Inspecting raw HTTP.
Form Data with cURL
Apart from JSON, APIs and servers often receive data as form data, especially from HTML forms and file uploads.
1. Sending Form Data
Using cURL to send form-encoded and multipart data.
HTTP Overview
HTTP (HyperText Transfer Protocol) is the foundation of communication between clients and servers.
1. Request–Response Model
How HTTP communication works.
2. Stateless Nature of HTTP
Why HTTP does not remember clients.
HTTP Methods
HTTP methods define the intent of a request.
1. Read & Safe Methods
Methods that do not modify data.
2. Write & Modify Methods
Methods that change server state.
HTTP Headers
Headers carry metadata about requests and responses.
1. Request Headers
Headers sent by clients.
2. Response Headers
Headers sent by servers.
Status Code & Status Message
Every HTTP response includes a numeric status code and a textual status message.
1. Status Code
Numeric response indicator.
2. Status Message
Human-readable description.
HTTP Body
The body carries the actual data being sent.
1. Request Body
Data sent by client.
2. Response Body
Data returned by server.
Cookies & State
Although HTTP is stateless, cookies allow servers to maintain state.
1. What Are Cookies
Client-side storage.
2. Cookies vs Headers
Where cookies fit in HTTP.