<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":4349,"date":"2022-05-16T12:33:08","date_gmt":"2022-05-16T12:33:08","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4349"},"modified":"2022-05-16T13:42:43","modified_gmt":"2022-05-16T13:42:43","slug":"what-is-cors","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/","title":{"rendered":"What is Cors ?"},"content":{"rendered":"<ul>\n<li style=\"text-align: justify;\">CORS- Cross-Origin Resource Sharing.<\/li>\n<li style=\"text-align: justify;\">It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.<\/li>\n<li style=\"text-align: justify;\">In order to check that the server will permit the actual request, CORS also relies on a mechanism by which browsers make a &#8220;preflight&#8221; request to the server hosting the cross-origin resource.<\/li>\n<li style=\"text-align: justify;\">The browser sends headers that indicate the HTTP method and headers that will be used in the actual request in Preflight.<\/li>\n<li style=\"text-align: justify;\">Browsers restrict cross-origin HTTP requests initiated from scripts for security purposes.<\/li>\n<li style=\"text-align: justify;\">A web application using those APIs can only request resources from the same origin the application was loaded from unless the response from other origins includes the right CORS headers.<\/li>\n<li style=\"text-align: justify;\">Data transfers between browsers and servers and CORS mechanism supports secure cross-origin requests.<\/li>\n<li style=\"text-align: justify;\">This article is for\u00a0front-end developers, web administrators and server developers.<\/li>\n<\/ul>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4350 aligncenter\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png\" alt=\"\" width=\"1439\" height=\"1172\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png 1439w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors-300x244.png 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors-1024x834.png 1024w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors-768x626.png 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors-390x318.png 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors-820x668.png 820w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors-1180x961.png 1180w\" sizes=\"(max-width: 1439px) 100vw, 1439px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CORS- Cross-Origin Resource Sharing. It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources. In order to check that the server will permit the actual request, CORS also relies on a mechanism by which browsers make [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[17079],"tags":[17315,17318,17319,17317,17328,17314,17326,17320,17316,17324,17322,17323,17313,17321,17327,17325],"class_list":["post-4349","post","type-post","status-publish","format-standard","hentry","category-web-designing","tag-cors-example","tag-cors-npm","tag-cors-policy","tag-cors-vulnerability","tag-is-cors-necessary","tag-what-is-cors","tag-what-is-cors-and-how-does-it-work","tag-what-is-cors-in-aws","tag-what-is-cors-in-web-api","tag-what-is-the-purpose-of-cors","tag-what-is-the-use-of-cors","tag-what-is-the-use-of-cors-filter","tag-what-is-the-use-of-cors-in-node-js","tag-what-is-the-use-of-cors-in-web-api","tag-why-cors-is-important","tag-why-is-cors-important"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Cors ? - Cross-Origin Resource Sharing (CORS) - Web Designing<\/title>\n<meta name=\"description\" content=\"What is Cors ? - It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Cors ? - Cross-Origin Resource Sharing (CORS) - Web Designing\" \/>\n<meta property=\"og:description\" content=\"What is Cors ? - It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-16T12:33:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-16T13:42:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/\",\"name\":\"What is Cors ? - Cross-Origin Resource Sharing (CORS) - Web Designing\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png\",\"datePublished\":\"2022-05-16T12:33:08+00:00\",\"dateModified\":\"2022-05-16T13:42:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"What is Cors ? - It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/#primaryimage\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png\",\"contentUrl\":\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png\",\"width\":1439,\"height\":1172},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\/\/www.wikitechy.com\/interview-questions\"],\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Cors ? - Cross-Origin Resource Sharing (CORS) - Web Designing","description":"What is Cors ? - It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/","og_locale":"en_US","og_type":"article","og_title":"What is Cors ? - Cross-Origin Resource Sharing (CORS) - Web Designing","og_description":"What is Cors ? - It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/","og_site_name":"Wikitechy","article_published_time":"2022-05-16T12:33:08+00:00","article_modified_time":"2022-05-16T13:42:43+00:00","og_image":[{"url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png"}],"author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/","name":"What is Cors ? - Cross-Origin Resource Sharing (CORS) - Web Designing","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png","datePublished":"2022-05-16T12:33:08+00:00","dateModified":"2022-05-16T13:42:43+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"What is Cors ? - It is header-based mechanism that allows a server to indicate any origins like scheme, domain, or port other than its own from which a browser should permit loading resources.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/web-designing\/what-is-cors\/#primaryimage","url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png","contentUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/05\/what-is-cors.png","width":1439,"height":1172},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4349"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4349\/revisions"}],"predecessor-version":[{"id":4351,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4349\/revisions\/4351"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}