Brief overview of some HTTP Concepts

Objectives

  • Explain what an HTTP server is
  • Explain what an HTTP request is
  • Explain what an HTTP response is
  • Identify the parts of a Uniform Resource Locator (URL)
  • Describe the parts of a URL

What is a web server? 

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.

What's an HTTP Request?

The client (or user agent) sends a plain-text message called an HTTP Request to a server on behalf of the user.

What's an HTTP Request Composed Of?

  • 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?

What's an HTTP Response?

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.

What's an HTTP Response Composed Of?

  • An HTTP version
  • A status code
  • Key-value headers
  • And an optional body

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?

HTTP Concepts Overview

By Hamid Aghdaee

HTTP Concepts Overview

  • 695