HTTP Deep Dive – Request/Response and
Header Analysis
Nayana BM
M.tech., 2nd Sem
CIT. Gubbi
Objective:
Explore the HTTP protocol by analyzing live requests and understanding its stateless
behavior.
Overview:
HTTP (Hypertext Transfer Protocol) is the foundation of data exchange on the web. It is a
stateless, text-based protocol that uses a request-response model.
● A client sends an HTTP request (GET/POST/etc.) to a server.
● The server processes it and returns an HTTP response.
Each interaction is independent; servers do not remember previous requests, hence the
term stateless.
Tools Used:
● Postman – For sending and analyzing HTTP requests
● cURL (Command Line) – For scripting and command-based testing.
● Browser Developer Tools (Chrome) – For real-time header inspection.
Sample HTTP Requests & Screenshots
1. Using Postman
Endpoint: http://localhost:8080/api/public
Headers Sent:
GET /api/public HTTP/1.1
User-Agent: PostmanRuntime/7.36.1
Accept: */* (can be any format say application/json, application/xml etc)
With someother default headers from POSTMAN
Response:
"Hello from public endpoint"
Status: 200 OK
POST Request with Authentication (JWT Token)
Endpoint: http://localhost:8080/auth/login
Body (raw JSON):
{
"username": "admin",
"password": "password"
}
Response:
"eyJhbGciOiJIUzI1NiIsInR..."
Status: 200 OK
GET Private Endpoint with Token
Endpoint: http://localhost:8080/api/assignments
Header:
Authorization: Bearer <your_jwt_token_generated_on_login>
Response:
Status : 200 OK
{
"username": "admin",
"email": "[email protected]",
"assignments": [
"Assignment 1",
"Assignment 2"
]
}
GET Private Endpoint with Token
Endpoint: http://localhost:8080/api/assignments
Header:
Authorization: Bearer null
Response:
403 forbidden (Since the token not sent, it was not authorized)..
2. Using cURL (Screenshots)
For getting this done in localhost, created simple springboot application which returns sample
data using REST controller mappings.
Below screenshot depicts request/response flow using localhost public api.
Below screenshot depicts request/response which uses live public api endpoint.