1. Library
  2. Http and the Web
  3. Status Codes

Updated 10 hours ago

Every other HTTP status code is a period at the end of a sentence. 1xx codes are commas.

These informational responses say "I received your request, I'm working on it, but I'm not done yet." Unlike a 200 or 404, a 1xx response doesn't end the HTTP transaction—it's an interim update, always followed by a final status code.

You rarely see them directly. But they're working underneath, enabling some of HTTP's cleverest tricks.

100 Continue: "Are You Sure?"

Imagine you're about to upload a 1GB video. You click submit. The file starts uploading. Thirty seconds later, the server responds: 401 Unauthorized.

You just wasted bandwidth and time uploading data the server was never going to accept.

The 100 Continue protocol prevents this. It's HTTP asking "are you sure?" before you commit:

Client sends headers only:

POST /api/upload HTTP/1.1
Host: example.com
Authorization: Bearer token123
Content-Length: 1073741824
Expect: 100-continue

Server checks the headers. Is the token valid? Is there room for this file? Is the content type acceptable?

If everything looks good:

HTTP/1.1 100 Continue

Now the client sends the 1GB body.

If something's wrong:

HTTP/1.1 401 Unauthorized

The client never sends the body. A gigabyte of bandwidth saved.

Most HTTP libraries handle this automatically for large uploads. The Expect: 100-continue header triggers it. You benefit without writing any special code.

101 Switching Protocols: "Let's Speak Differently"

HTTP is a request-response protocol. Client asks, server answers. But what if you need real-time bidirectional communication—a chat app, live updates, multiplayer games?

You start with HTTP, then upgrade to something else.

Client requests WebSocket upgrade:

GET /chat HTTP/1.1
Host: example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13

Server agrees:

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=

After this exchange, the connection is no longer HTTP. It's a WebSocket—full duplex, either side can send messages anytime.

You'll never write this code yourself. WebSocket libraries handle it. But when you see 101 Switching Protocols in your network inspector during a WebSocket connection, now you know what happened: HTTP politely stepped aside.

103 Early Hints: "Start Loading These"

This one's about performance. Here's the problem:

Your server needs 200ms to query the database and render HTML. The browser can't start loading CSS and JavaScript until it receives and parses that HTML. That's 200ms of wasted time where the browser sits idle.

103 Early Hints lets the server say "I'm still working, but start loading these":

Immediately, before the HTML is ready:

HTTP/1.1 103 Early Hints
Link: </style.css>; rel=preload; as=style
Link: </main.js>; rel=preload; as=script

The browser starts fetching those resources while the server is still querying the database.

200ms later, the real response:

HTTP/1.1 200 OK
Content-Type: text/html

<html>
  <link rel="stylesheet" href="/style.css">
  <script src="/main.js"></script>
  ...
</html>

By the time the browser parses the HTML, the CSS and JavaScript are already loading—or already loaded.

Early Hints shine when server processing is slow and you know which resources the page will need. The browser does useful work during what would otherwise be dead time.

Browser support is growing. Chrome and Edge support it fully. Browsers that don't understand 103 simply ignore it—no harm done.

You Won't See Them

In your application code, 1xx responses are invisible:

const response = await fetch('/api/upload');
console.log(response.status); // 200, 404, 500... never 100 or 103

The browser handles them at a lower level. The fetch API only surfaces the final response.

WebSocket connections abstract away the 101:

const socket = new WebSocket('wss://example.com/chat');
// The protocol upgrade happened. You never saw it.

To see 1xx responses, use browser DevTools (check the Network tab's response details) or command-line tools like curl with -v for verbose output.

Why They Matter

1xx codes solve real problems:

100 Continue saves bandwidth on doomed uploads. Why send a gigabyte if the server will reject it based on headers alone?

101 Switching Protocols enables the real-time web. Every WebSocket connection starts here.

103 Early Hints makes pages load faster by parallelizing work between server and browser.

They also show how HTTP evolves gracefully. By reserving a category for interim responses, the protocol can add new ones without breaking existing clients. A browser that doesn't understand 103 just ignores it and waits for the final response.

You probably won't implement custom 1xx handling. But you benefit from it constantly—every WebSocket connection, every large upload, every page that loads a little faster because hints arrived early.

Frequently Asked Questions About 1xx Status Codes

Was this page helpful?

😔
🤨
😃