Sitemap
Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

CORS Preflight Request

5 min readMay 16, 2025

--

Press enter or click to view image in full size
preflight request

Ever wonder what a preflight request is ???? Let’s get deeper into this today !!

What Is a Preflight Request?

A preflight request is an HTTP OPTIONS request sent before the actual request. Its purpose is to ask the server whether the actual request is safe to send.

It is called “preflight” because it’s like checking the conditions before “taking off” with the actual HTTP request.

Why Is It Needed?

Before going into details, of why its needed, lets understand what is origin.

Definition of “Origin”

An origin is defined by three components:

Origin = Protocol + Host + Port

Example :

Press enter or click to view image in full size
  • Even a different subdomain, protocol, or port means a different origin.

Now, the browsers enforce a same-origin policy for security reasons. Just for understanding better, the Same-Origin Policy (SOP) is a security feature implemented by web browsers to restrict how documents or scripts loaded from one origin can interact with resources from another origin.

--

--

Abhishek Jha
Abhishek Jha

Written by Abhishek Jha

Senior Software Developer at Oracle Cloud (OCI)📕| Ex-Amazon (📘) & Teradata (📒 ) | Gold Medalist in BE-Computer Science, Chandigarh University '20

Stackademic
Stackademic

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.