What is the structure of an HTTP request and response?
BeginnerConceptHTTP, TLS & Certificates
Answer
A request has a request line (method, path, version), headers, a blank line and an optional body. A response has a status line, headers, a blank line and a body.
curl -v https://example.com/health
# > GET /health HTTP/2
# > Host: example.com
# < HTTP/2 200
# < content-type: application/json
HTTP is stateless: cookies, tokens and sessions carry state.
More on HTTP, TLS & Certificates
Which HTTP status code classes and codes should every DevOps engineer know?BeginnerWhat are the common HTTP methods and which are idempotent?BeginnerWhat changed between HTTP/1.1, HTTP/2 and HTTP/3?IntermediateHow does QUIC differ from TCP+TLS?AdvancedWhat are HTTP keep-alive and connection reuse, and why do they matter?AdvancedWhat is the difference between HTTP and HTTPS?Beginner