Skip to content Skip to sidebar Skip to footer

Response For Preflight Is Invalid In Angular

I am trying to perform test using apiary api as the following: $scope.createAsset = function () { $http({ method: 'POST', url: 'http://polls.apiblueprint.org/createStory'

Solution 1:

You have a misunderstanding of CORS: The Access-Control-Allow-Origin header comes from the server, not the client. It's the server that decides whether to allow a cross-origin call.

There's nothing you can do in your client-side code to enable a cross-origin call if the server doesn't support it.

Solution 2:

I don't think you have to set "Access-Control-Allow-Origin", but rather you might be missing some additional parameters since it is a POST call. If you have API method details then check what are the parameters required in "@RequestParams".Hope this might help.

Post a Comment for "Response For Preflight Is Invalid In Angular"