angularjs - Restangular prevent 'preflight' OPTIONS call -


i'm trying figure out how prevent options call firing on every call our api server.

i'm trying right now:

.config(function(restangularprovider) {     restangularprovider.setdefaultheaders({"x-requested-with" :"", "content-type": "text/plain"}); }) 

but it's not doing me good. still thinks it's application/json fires off preflight call. there can do?

check out:

options requests call pre-flight requests in cross-origin resource sharing (cors).

they necessary when you're making requests across different origins.

this pre-flight request made browsers safety measure ensure request being done trusted server. meaning server understands method, origin , headers being sent on request safe act upon.

your server should not ignore handle these requests whenever you're attempting cross origin requests.

how disable options request?


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -