python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
cross origin request

Cross Origin Request


When your script is running on one domain and your script request for a resource to other domain by using the XmlHttpRequest or XDomainRequst that this mechanism is called cross-origin Request.

Mythological, for security reasons these types of requests have been prohibited by browsers.

For example we can say

If your script on your page is running from code-sample.com domain and request a resource  to angulardoc.com domain  by the XmlHttpRequest or XDomainRequst, this is a cross-origin request.  Historically, for security reasons these types of requests have been prohibited by browsers.


The CORS mechanism works to adding HTTP headers to cross-domain HTTP requests and responses.
Pre-flight Request for CORS : Is used to check the validate to the cross-domain HTTP requests and responses

Steps of pre-flight requests of CORS specification requires browsers as given below.

        1. Use  to request methods other than GET, POST, or HEAD etc.
        2. Use to custom headers for each request
       3.  Use to request bodies with Content-Type other than text/plain, application/x-www-form-url encoded, or multipart/form-data etc.



Thank you!
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions