RapidAPI Profile picture
Mar 3 β€’ 15 tweets β€’ 2 min read
A brief introduction to ten widely used HTTP Headers.

A Thread πŸ§΅πŸ‘‡πŸ»
In this thread, we are going to discuss:

β€’ Accept
β€’ Accept-Encoding
β€’ Authorization
β€’ Accept-Language
β€’ Content-Type
β€’ Content-Location
β€’ Content-Encoding
β€’ Content-Length
β€’ Content-Language
β€’ Cache-Control
Client and server can pass the extra bit of information with the request and response using HTTP headers.

HTTP headers are not case-sensitive.
The HTTP headers are divided into four categories:

1️⃣ Request headers: Client to Server

2️⃣ Response headers: Server to Client

3️⃣ Representation headers: Information about the body of the resource

4️⃣ Payload headers: Information about the payload data
πŸ“Œ Accept

`Accept` header is used when the client wants to inform the server about the type of data that the client can understand.

For example,

Accept: image/png
πŸ“Œ Accept-Encoding

The `Accept-Encoding` header is usually attached with a request to the server, indicating which encoding method is understandable by the client.

For example,

Accept-Encoding: gzip
πŸ“Œ Authorization

As the header name suggests, the `Authorization` request header is used to pass the credentials so that the server can authenticate the client.

For example,

Authorization: Basic dgfhWUytzgdfhgSYG
πŸ“Œ Accept-Language

The `Accept-Language` request header is used to describe which language is understood by the client.

For example,

Accept-Language: en-US
πŸ“Œ Content-Type

`Content-Type` representational header specifies the media type of the resource. This header indicates the content type of the returned data when the client didn't mention any content encoding.

For example,

Content-Type: text/html; charset=UTF-8
πŸ“Œ Content-Location

`Content-Location` header indicates the alternate location for the response. It is used when an API can return data in different formats depending on the `Accept` header.

For example,

Content-Location: /examples/foo.json
Content-Location: /examples/foo.xml
πŸ“Œ Content-Encoding

The `Content-Encoding` header is used to compress the message data or payload.

For example,

Content-Encoding: gzip
πŸ“Œ Content-Length

As the header name suggests, it indicates the size of the resource or message body in bytes. It can be used with both request and response.

For example,

Content-Length: 148
πŸ“Œ Content-Language

`Content-Language` indicates the human logical language of the response. This header is used to deliver resources in multiple languages so that users can choose their preferred language.

For example,

Content-Language: en-US
πŸ“Œ Cache-Control

`Cache-Control` header is used as a caching mechanism for both the request and response.
There are several directives(values) that we can pass with this header.

For example,

Cache-Control: max-age
With that being said, this is the end of this thread.

Follow @Rapid_API for more excellent content. πŸ’™πŸš€

Peace out!

β€’ β€’ β€’

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 4
Let's discuss five best practices for designing GraphQL APIs.

A Thread 🧡 πŸ‘‡πŸ»
GraphQL solves the problem of over-fetching and under-fetching that we often get in REST API.
If you are unaware of these two terms.

Over-fetching is fetching too much data.

Under-fetching is not having enough data, forcing you to call a second endpoint.
Read 14 tweets
Mar 3
Top ten Food APIs you can use in your next project.

A Thread πŸ§΅πŸ‘‡πŸ»
1️⃣ Recipe-Food-Nutrition

Over 365,000 recipes and 86,000 food products. Analyze food images by uploading a file or by a given URL.

πŸ”— RapidAPI.com/spoonacular/ap…
2️⃣ Tasty

Use the Tasty API to get data about recipes, ingredients, nutrition, and much more. You can also filter recipes according to the time they take.

πŸ”— RapidAPI.com/apidojo/api/ta…
Read 12 tweets
Mar 2
Building an API is not difficult as it sounds.

Let's create a quick number API using which we can fetch even, odd, and prime numbers.

Thread πŸ§΅πŸ‘‡πŸ»
Prerequisite:

We are assuming you have Node.js installed on your machine. If you haven't installed it, click on the following link and install it simply.

nodejs.org/en/
Let's start with creating an empty directory and initializing the project by running the following command. Creating an empty directory...
Read 21 tweets
Mar 2
Top ten Facial Recognition APIs.

Thread πŸ§΅πŸ‘‡πŸ»
1️⃣ Mirror-AI

Upload photos and get personalized avatars and emojis for your users.

πŸ”— RapidAPI.com/mirror-dev-tea…
2️⃣ Face Detection

Use Face Detection API to detect the location of human faces in your images with optional extra features like Age and Gender.

πŸ”— RapidAPI.com/inferdo/api/fa…
Read 12 tweets
Mar 1
Everything you need to know about SOAP API.

Thread πŸ§΅πŸ‘‡πŸ»
SOAP is a necessary protocol that helped introduce the widespread use of APIs.

SOAP is the acronym for Simple Object Access Protocol.
SOAP is a standardized protocol that relies on XML to make requests and receive responses.

Even though SOAP is based on XML, the SOAP protocol is still in wide usage.
Read 18 tweets
Mar 1
Anatomy of an API endpoint.

Thread πŸ§΅πŸ‘‡πŸ»
Before breaking the endpoints into multiple parts. Let's first see what exactly is an endpoint.

The endpoint is nothing but the URL to access resources.

Every API must have at least one endpoint.
A typical endpoint or URL starts with the scheme.

Scheme is nothing but the protocol for APIs.

For example, HTTPS, HTTP, FTP, SSL, etc. Anatomy of an endpoint showing scheme.
Read 10 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!

:(