What is the pre-flight Request | Everything about CORS explained in plain English

  Рет қаралды 2,401

Krish Dinesh

Krish Dinesh

2 жыл бұрын

Cross-Origin Resource Sharing (CORS) is an HTTP header-based mechanism that allows servers to specify origins (domains, schemes, or ports) other than their own from which browsers are allowed to load resources. CORS also relies on a mechanism whereby the browser sends a "preflight" request to the server hosting the cross-origin resource to verify that the server will allow the actual request. During this preflight, the browser sends headers indicating the HTTP method and headers used in the actual request.
Cross-origin request example: Front-end JavaScript served by domain-a.com uses XMLHttpRequest to make a request to domain-b.com/data, returning json to place
For security reasons, browsers restrict cross-origin HTTP requests initiated by scripts. For example, XMLHttpRequest and Fetch API follow the same-origin policy. This means that web applications using these APIs can only request resources from the same origin the application was loaded from, unless responses from other origins contain the correct CORS headers.
CORS mechanism supports secure cross-origin requests and data transfer between browser and server. Modern browsers use her CORS in APIs like XMLHttpRequest and Fetch to reduce the risk of cross-origin HTTP requests.
Specifically, this video is aimed at his web admin, server developer, and front-end developer. Modern browsers handle the client side of cross-origin sharing, including applying headers and policies. However, the CORS standard means that the server has to handle new request and response headers.
Facebook: / krish.dinesh.official
Instagram : / krish.dinesh.official
twitter: / krishantha (@Krishantha)
#krishdinesh #cors #microservices

Пікірлер: 14
@samueldaniel7
@samueldaniel7 2 жыл бұрын
Well explained, Simplicity is the ultimate sophistication - Leonardo da Vinci
@sajisanjoris2759
@sajisanjoris2759 Жыл бұрын
Thank you again @Krish for the subject
@dylanm7638
@dylanm7638 Жыл бұрын
awesome explanation sir, thank you so much
@senaldolage4033
@senaldolage4033 2 жыл бұрын
Thank you sir for this! Please do more videos like this and more videos on your series 'how software engineer thinks, rather than just a developer'
@loathesome_pilk_drinker
@loathesome_pilk_drinker Жыл бұрын
Great video!
@OwinGunawardena
@OwinGunawardena 2 жыл бұрын
Came on youtube happily after adding enablecors to my project which I found from an article, and this is what was recommended at the top 😂
@krish
@krish 2 жыл бұрын
haa haaa ☺️
@amazingartsongs5298
@amazingartsongs5298 2 жыл бұрын
Thank you so much for this. Had nightmare for weeks last year because of this. even try to contact you through FB during that time.
@shashira7220
@shashira7220 Жыл бұрын
Great explanation 💕
@dilieprathnayake4219
@dilieprathnayake4219 2 жыл бұрын
superb
@rukshandevelopment2205
@rukshandevelopment2205 2 жыл бұрын
Nice.. In my case I found that, pre-flight request is success but its gives CORS error, due to a invalid token in actual call. (Browser : Chrome). I only able to find the issue by analyzing Network calls.
@samueldaniel7
@samueldaniel7 2 жыл бұрын
Thank you
@hishamahammmedkm1936
@hishamahammmedkm1936 2 жыл бұрын
liked
@kalharadineth
@kalharadineth 2 жыл бұрын
wedak ati deyk demmanm hri
Web Server Concepts and Examples
19:40
WebConcepts
Рет қаралды 239 М.
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 36 МЛН
How to Become the Best in the Field
6:44
Krish Dinesh
Рет қаралды 708
What is a Server? (Deepdive)
17:51
LiveOverflow
Рет қаралды 173 М.
If You Want a Successful Career, Do Not Do This
7:46
Krish Dinesh
Рет қаралды 1,2 М.
Cross-Origin Resource Sharing (CORS) | Complete Guide
52:17
Rana Khalil
Рет қаралды 68 М.
What is a PREFLIGHT REQUEST? And how is it relevant to CORS?
18:52
Deeecode The Web
Рет қаралды 563
What is CORS?
13:22
A shot of code
Рет қаралды 64 М.
What is a REST API?
9:12
IBM Technology
Рет қаралды 1,5 МЛН
Why I No longer Hate CORS and Why you should too!
13:10
CoderOne
Рет қаралды 17 М.