About
An HTTP response is a message sent from a server to a client in response to a request.
Example
Example of a response that returns an HTML document
HTTP/1.1 200 OK
Date: Sun, 14 Feb 2021 13:39:15 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: Session=Z2VyYXJkbm; path=/; secure; HttpOnly
X-UA-Compatible: IE=edge,chrome=1
Server: datacadamia.com
Content-Length: 66697
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" style="font-size:">
<head>
<meta name="generator
...
</html>
Format
The response message has:
- followed by headers
- followed optionally by a body
- the requested resource (the type (Mime))
- HTML page (What we get generally in the browser)
- XML
- Json
- …
- an error message,
- or some other information
Headers
Most known Response header
Content Type
CSP
Cors
Creation
A response is produced by an handler