RapidAPI Profile picture
Mar 9 โ€ข 25 tweets โ€ข 3 min read
Everything you need to know about HTTP Requests.

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
Before jumping onto HTTP Requests, let's first discuss a bit about HTTP.

HTTP stands for HyperText Transfer Protocol.
HTTP is entirely based on the client-server model.

The client initiates the request then waits until it receives a response from the server.
The client can initiate the request using HTTP request methods.

HTTP request methods are the actions initiated from the client-side to get the desired resource.
There are 9 HTTP request methods:

- GET
- PUT
- POST
- HEAD
- TRACE
- PATCH
- DELETE
- OPTIONS
- CONNECT
But there are four widely used HTTP verbs:

๐Ÿ“„ GET (read existing data)
๐Ÿ“ฒ POST (create a new response or data)
โ™ป๏ธ PATCH (update the data)
๐Ÿ—‘๏ธ DELETE (delete the data)
๐Ÿ“Œ GET

The GET method is the most common of all these request methods. It is used to get the desired resources from the server.

The GET methods don't affect the state of the server.
๐Ÿ“Œ POST

The POST method is used to submit the information to the server. As we're submitting data, the POST method often changes the state of the server.
๐Ÿ“Œ PUT

The PUT method is used whenever you need to change the resource. The resource, which is already a part of resource collection.
๐Ÿ“Œ PATCH

The PATCH request method is used to modify only the necessary part of the data or response. The PATCH method doesn't modify the entire response.
๐Ÿ“Œ HEAD

The server sends the response without the body. The HEAD method asks for a response identical to that of a GET request, but it is faster as small data is transferred.
๐Ÿ“Œ DELETE

As the name says, the DELETE request method is used to delete the specified resource.

It requests that the origin server delete the resource identified by the Request-URL.
๐Ÿ“Œ CONNECT

The CONNECT method establishes two-way communication between the client and the requested resource.

CONNECT request method is used to push your proxy to start an HTTP tunnel.
๐Ÿ“Œ OPTIONS

The OPTIONS method is used to describe the communication options available for the target resource.

The client can either specify a URL for describing the communication options available for a specific resource or an asterisk (*) if they want to target the server.
๐Ÿ“Œ TRACE

The TRACE method is generally used for debugging. It performs a message loop-back test along the path to the desired data.
There are three main characteristics of HTTP Request Methods:

1. Safe
2. Idempotent
3. Cacheable
๐Ÿ“Œ Safe

We can call an HTTP request method safe if it doesn't affect the server's state.

The safe methods request the server to send data without performing any modification to the original data.

Hence safe methods accomplish read-only operations.
Even though they are read-only operations, they sometimes cause a change in server state; the server can update its statistics.

One thing to note here is that the safe methods never request the server to change its state.
๐Ÿ“Œ Idempotent

Idempotent methods have no side effects on the server.

We can call them in a row, and they guarantee that they will not affect the server state (except for keeping statistics).

GET, HEAD, OPTIONS, PUT, DELETE, and TRACE methods are idempotent.
All safe methods are idempotent, but not all idempotent methods are safe.

To be an idempotent method, only the state of the server matters, not the code returned by it. Hence DELETE method is idempotent but not safe.
Another thing to note here is that the client-side ensures the validation of idempotence. The bad codebase can shatter the idempotent constraint.
๐Ÿ“Œ Cacheable

As the term suggests, we can call HTTP response methods cacheable if it is possible to cache the response for later use.

However, there are some constraints: ๐Ÿ‘‡๐Ÿป
Constraints for an HTTP response to be cached:

1. Method should be cacheable. Only GET and HEAD methods are cacheable.

2. PUT and PATCH can be cached if the `Content-Location` header is set.
3. Only a few status codes are cacheable: 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, and 501.

4. Headers like `Cache-Control` can be used to prevent caching.
With that being said, this is the end of this thread.

Make sure to follow @Rapid_API for more exclusive content. ๐Ÿ™๐Ÿ’™

โ€ข โ€ข โ€ข

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

Keep Current with RapidAPI

RapidAPI 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 @Rapid_API

Mar 11
Definitions of most widely used terms in API development:

- SDK
- RPC
- CORS
- API Key
- Async API
- Internal API
- API Caching
- External API
- HTTP cookies
- Authorization
- Microservices
- OpenAPI spec
- Composite API
- API Versioning
- Authentication

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
๐Ÿ“Œ SDK

SDK stands for Software Development Kit.

It is a set of development tools that allows the creation of software or an application for a particular platform.

SDK provides you with the whole package from compilers to debuggers to even a software development framework.
๐Ÿ“Œ RPC

Remote Procedure Call (RPC) is the oldest client-server communication method in use today.

Instead of the traditional HTTP call, RPC uses a function call.

It means that you invoke a function written on the server-side code on the client-side.
Read 17 tweets
Mar 11
Have some difficulties understanding what an API is?

Take a look at this RapidAPI Comic. ๐Ÿงต๐Ÿ‘‡๐Ÿป

{ 1 / 6 } What is an API?
{ 2 / 6 } What is an API request?
{ 3 / 6 } Fetching needed data for th...
Read 6 tweets
Mar 10
There are four types of Web APIs:

- Public API
- Private API
- Partner API
- Composite API

Let's discuss them briefly. ๐Ÿงต๐Ÿ‘‡๐Ÿป
1๏ธโƒฃ Public API

Public APIs are accessible to all developers with a low or moderate level of authentication and authorization.

For example, the Windows API of Microsoft is a public API.
Stability is an essential factor of any public API.

Any changes in the public API, let's say adding a new parameter, might break the applications that depend on that API.
Read 9 tweets
Mar 9
Top ten Sports APIs you can use in your next project.

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
1๏ธโƒฃ API-BASKETBALL

Over 190 Basketball Leagues & Cups with Livescore, Odds, Bookmakers, Statistics.

๐Ÿ”— RapidAPI.com/api-sports/apiโ€ฆ
2๏ธโƒฃ API-FOOTBALL

You will get access to over 870 football leagues and cups. You can get a live score as well if you use this API.

๐Ÿ”— RapidAPI.com/api-sports/apiโ€ฆ
Read 11 tweets
Mar 8
How to make an API call in Python?

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
In this thread, we are going to discuss how we can make an HTTP request in Python.
We are using the `requests` module.

It allows us to make HTTP requests. It is the most popular and easiest way in Python to send HTTP requests.
Read 13 tweets
Mar 8
Everything you need to know about API Testing and its types.

A Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
API testing is performed to test whether a particular API meets pre-defined parameters or not.
API testing includes testing APIs in isolation to ascertain if they meet:

โ€ข Functionality
โ€ข Reliability
โ€ข Latency
โ€ข Performance
โ€ข Security and other essential parameters.
Read 14 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 on Twitter!

:(