1xx HTTP status codes : Informational

Amritanshu Verma
2 min readJan 3, 2021

As we know that whenever a client sends a request to the server, the server responds with a status code with the response. While some of the status codes like 404, 200, 503 are so well known, there are some which are rarely used and seldom talked about.

One such family is the 1XX status codes, which are the informational status codes.

Before we dive into the specific codes, let us see what these 1XX codes are. As the name suggests, they are informational codes. Unlike the other status code families, they are sent before the actual regular response. The 1XX responses only contain the status code, optional headers and are terminated by an empty line.

Let us bring upon Alice (a client), and Bob ( a server) to help us understand what these status codes are.

100 Continue

Let us say that Alice sends a request to Bob. It so happens that the request is too long to be put in a single message, so Alice splits the request into various parts and starts sending it to Bob. She wonders how would she know if the requests are reaching Bob because Bob will only be able to respond once he has the complete request. What she can do is, when sending the request, she can add Expect: 100-continue in the initial request. By doing this, she is saying to Bob, “Hey Bob! I expect to know if everything is fine and that I can continue.” If yes, Bob replies back with, “Hey Alice! FYI, 100 Continue. All looks good to me till now. Please continue sending requests if you have any.” This way Alice is not in any kind of doubt anymore about her requests. Yay!

101 Switching Protocols

Now, let us say Alice wants some change in protocol, or in very simple terms, Alice wants to use some different rules of communication. So, Alice says, “Hey Bob! I prefer Rule SomeProtocol2.” If Bob is okay using that protocol, he replies back with, “Hey Alice, FYI I acknowledge your request of changing the protocols and I am okay with it, 101: I am switching the protocol to SomeProtocol2. So our further communication will be according to SomeProtocol2”

103 Early Hints

Now, Bob is taking some time to form a proper response. When he is doing that, Alice is just idly waiting for the response. Bob realises that there will be some links in the final response which Alice would have to evaluate at her own end. So, what Bob decides to do is, he sends Alice a message saying, “Hey Alice! FYI, 103 <links…>”. What he means by this is, “Hey Alice! These <links…> are probably going to be there in the final response, so why don’t you go ahead and evaluate these beforehand while I am working on the final response.”

That was about the 1xx HTTP status codes. Hope this was informative!

References

--

--