An HTTP Serveris a program that runs in an infinite loop, accepting HTTP requests from a client and sending HTTP responses back to it. Inside those responses, HTTP servers often include data like HTML, CSS, JavaScript, and JSON among other formats.
The client (or user agent) sends a plain-text message called an HTTP Request to a server on behalf of the user.
A method (or verb)
A path
An HTTP version
Key-value headers
And an optional body
Looking at the message below, can you identify the various parts of the HTTP request?
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:8000
User-Agent: HTTPie/0.9.3
Can you name some HTTP Methods?
When do you use GET and when would you use POST?
When the server receives an HTTP request, its job is to process the request and sends a plain-text message, called an HTTP Response, back to the client.
Here's an example of an HTTP Response, can you name its various parts?
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 11
Content-Type: text/plain
Date: Mon, 13 Jun 2016 04:28:36 GMT
Hello world
What are Status Codes?
What are the different parts of a URL?