Fernando 🇮🇹🇨🇭 Profile picture
Jul 19 9 tweets 3 min read Read on X
Every software developer needs to know how the HTTP protocol works.

Here are the 8 fundamental things you need to grasp: ↓ Image
1. What is HTTP

HTTP is an application-level protocol based on a request-response paradigm.

Its primary use is encoding and transporting information between a client and a server.

A typical HTTP transaction is made of 2 steps:

• a client sends a request message to a server

• the server replies with a response message
2. HTTP messages

A message is a block of text composed of multiple fields.

The main fields of an HTTP message are:

• the start line, indicating what a request is for or if the request was successful

• the headers, composed of key-value pairs metadata describing the message

• the (optional) body containing the data
3. Requests

An HTTP server hosts resources like documents, images, or collections of other resources.

HTTP requests allow you to Create, Read, Update, or Delete these resources.

Each request is stateless and contains all the necessary information to process it. Image
4. Request methods

The requested CRUD operation is specified in the start line of the message by a request method.

The most commonly used methods are:

• GET: retrieve a resource

• PUT: update a resource

•POST: create a resource returning its URL

• DELETE: remove a resource
5. Properties

A request method can have 2 important properties:

• Safety: the method has no side effects and can be cached. GET is safe, PUT, POST, DELETE, no

• Idempotency: the method can execute multiple times with the same result. GET, PUT, DELETE are idempotent, POST no
6. Responses

HTTP responses contain a status code informing the clients if their requests succeed.

There are different code ranges:

• 200-299 indicate success

• 300-399 communicate a redirection

• 400-499 communicate client errors

• 500-599 indicate server errors Image
7. Transport layer

HTTP needs a transport layer protocol to ensure a reliable and secure communication channel.

Usually, this protocol was TCP, but the latest HTTP version uses its UDP-based transport protocol.

When HTTP runs on top of TLS, it's referred to as HTTPS.
8. Versions

HTTP has multiple versions:

• 1.1 a TCP connection can be used for multiple transactions, but those need to be serialized

• 2.0 multiple transactions can be multiplexed on a TCP connection

• 3.0 an UDP transport protocol further optimizes the communication

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Fernando 🇮🇹🇨🇭

Fernando 🇮🇹🇨🇭 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Franc0Fernand0

Jul 16
As a senior software engineer, you should read these famous white papers from big tech companies (AWS, Google, Meta,..): ↓
1. Dynamo: Amazon’s Highly Available Key-value Store

cs.cornell.edu/courses/cs5414…

2. Spanner: Google’s Globally-Distributed Database

static.googleusercontent.com/media/research…

3. Scaling Memcache at Facebook

usenix.org/system/files/c…
4. Zanzibar: Google’s Consistent, Global Authorization System

storage.googleapis.com/gweb-research2…

5. The Google File System

static.googleusercontent.com/media/research…

6. Bigtable: A Distributed Storage System for Structured Data

static.googleusercontent.com/media/research…
Read 7 tweets
Jun 25
If you're a software engineer who wants to learn the core concepts about system design and distributed systems, read these 12 articles: ↓ Image
1. How RAFT solves the consensus problem in distributed systems: a step-by-step breakdown that every engineer can understand.

newsletter.francofernando.com/p/the-raft-con…
2. How the TLS protocol works under the hood and why it's important.

newsletter.francofernando.com/p/understandin…
Read 13 tweets
Jun 14
What is API pagination?

A lot of times, REST APIs need to return 100+ results.

API pagination is a way to break such data into chunks that are easy to work with.

This improves user experience and reduces server load.

These are the 3 kind of API pagination you need to know: ↓ Image
1. Offset-Based

The API uses two parameters: "offset" determines the position in the dataset, while "limit" specifies the maximum number of data to include on each page.

This approach became popular with apps using SQL, which already have LIMIT and OFFSET as part of the syntax.

Example: GET products?limit=20&offset40

Pros: It's simple to set up and lets you go straight to any page.

Cons: There are performance issues with large OFFSET values. It can cause data to be duplicated or skipped in dynamic datasets.
2. Keyset-Based

The API uses a key parameter (like since_id) to determine data limits. The first request doesn't contain the key parameter.

The other requests use the last key value from the previous set.

Example: GET /products?limit=20since_id=20

Pros: It is more efficient than page-based and keeps dynamic datasets from duplicates.

Cons: It is tied to the sort order and can't go straight to a certain page.
Read 4 tweets
Jun 11
If you are a software engineer serious about getting better at algorithms and data structures, read these 12 articles: ↓ Image
1. How to use the two-pointer method to efficiently solving array and string problems (with code templates).

newsletter.francofernando.com/p/mastering-th…
2. How to effectively use sets and hash tables to solve coding interview problems

newsletter.francofernando.com/p/hashing-in-c…
Read 13 tweets
Jun 7
Most developers think graphs are not important for their daily work.

But the reason is that they don't know graph algorithms and their use cases.

You will change your mind once you know these 5 algorithms: ↓ Image
1. Breadth-first search

It's a traversal algorithm implemented using a queue data structure.

It starts from a node and first explores all its adjacent nodes.

Then, it explores all nodes two steps away from the starting one, and so on.

Applications of BFS are:

● build web page indexes in web crawlers

● discover neighbor nodes in p2p networks

● find neighboring places in GPS navigation systems
2. Deepth First Search

It's a traversal algorithm implemented using a stack data structure.

It starts from a node and explores as far as possible along each path.

When no more nodes exist to explore in the current path, it retraces.

Applications of DFS are:

● find a path between 2 nodes

● detect cycles in a graph

● topological sorting

● solve maze or sudoku puzzles
Read 6 tweets
May 28
If you're a backend engineer who want to get better at system design, read these 13 articles: ↓ Image
1. Common mistakes software engineers make during system design interviews and how to avoid them.

newsletter.francofernando.com/p/how-not-to-f…
2. How Shopify uses sandboxing to build secure checkout pages

newsletter.francofernando.com/p/the-shopify-…
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(