0

I have a service that is consumed via jQuery and everything works ok. Now it is being consumed by Angular, but Angular does not send as POST / GET, it sends everything as OPTIONS.

I've changed the settings in the service to configure CORS. But I think it is right to find out why Angular does not send as POST / GET.

4
  • 1
    if that is in Portuguese try pt.stackoverflow.com Otherwise please translate to English Commented Sep 18, 2015 at 16:04
  • provide the angular code you are using.. are yo using the $http or the $resource, not nearly enough info :/ if $http, looks like $http.get() would send get.. docs.angularjs.org/api/ng/service/$http Commented Sep 18, 2015 at 16:19
  • possible duplicate of AngularJS performs an OPTIONS HTTP request for a cross-origin resource Commented Sep 18, 2015 at 16:51
  • Many reviewers has a lot to do and don't read the english part of the bottom, this is why I removed any non-english text. Commented Sep 18, 2015 at 19:15

1 Answer 1

2

Angular sends an OPTIONS request first to check the status of the CORS request before sending the actual GET or POST request. If the OPTIONS request does not have the appropriate CORS headers, the error is generated and the GET or POST request is not sent.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.