HTTP response

The message a server sends back: a protocol version, a status code and phrase, headers, a blank line and usually a body.

In more detail

Read every answer in that order: the status says what happened, the headers describe the body and how to treat it, and the body carries the representation or a problem document. In HTTP/1.1 the start line looks like HTTP/1.1 200 OK.

Examples

In the APIs course: The course calls this reading an answer as status, headers, body.
fmt.Println(response.StatusCode)
Go: resp.StatusCode, resp.Header, resp.Body
The status code gives the broad outcome and the headers describe the body, caching and more. Read the headers before assuming the body holds the whole reason for a failure.

Related terms

Taught in

References