Brief study of HTTP

Denzal Martin
2 min readAug 11, 2021

HTTP (aka for Hypertext transfer protocol) defines the process for communicating different types of information on the web. The hypertext part of HTTP is what a browser presents to us when we direct it to a specific URL. It’s considered hypertext because it is text that exists beyond the single document presented to a user, and the text beyond is connected by hyperlinks within a single document. Those hyperlinks are part of HTTP in that they are essentially GET requests (more about this below). HTTP is one of many different communication protocols that exist. These different protocols are defined within what’s called the internet protocol suite, but the focus here will be HTTP.

How is HTTP used? Well first, we can establish the concept of a client and a server. A client typically wants to obtain or modify information associated with a single webpage. As partially discussed above, HTTP is relevant here because certain pieces of information should be passed to and from the server so the server understands what it should do before sending a response. To start communication, the client (could be a browser) makes a request by specifying a method of GET or POST, the URL to request from, and the version of HTTP used. The server receives that request and generates a response which would minimally contain the version of the protocol and a status code (i.e. 1xx, 2xx, 3xx, 4xx, or 5xx). In both the request and response, headers can be specified that give information about the data being transferred (e.g. application/json, text/html, text/css, etc.), information about the client such as their identity, and many other pieces of information.

In the context of creating web pages, web developers should be able to make specific requests to servers so that we can display information on our web page. One way for developers to make specific requests is through the XMLHttpRequest API. This API allows a developer to decide a method for the request, with some of those being a GET, POST, HEAD, PUT, DELETE, and OPTIONS. The most familiar methods I’ve learned so far are the GET, POST, PUT, and DELETE and at least two methods are self-explanatory. POST is typically used for creating something on the server and PUT is used for updating something on the server. An XMLHttpRequest is one way of making a request, but Javascript now provides the fetch API that does the same thing with more additional features.

Some resources for this topic:

--

--

Denzal Martin
0 Followers

Software engineer with 3 years of experience creating code for collecting and analyzing data, maintaining software, and test automation using Python.