Answer the question
In order to leave comments, you need to log in
Cross domain request from domain.com to api.domain.com... how?
Hi all.
Wrote a small api for my project.
From the main domain mydomain.com I call using angular api.mydomain.com... does not give a bastard. How to get around? How are public APIs made? In the future, I plan to make the api open.
There is a hosting. In configs they do not allow climbing.
Thanks in advance.
This is what the console outputs:
XMLHttpRequest cannot load api.mydomain.com/?login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' mydomain.com ' is therefore not allowed access.
Answer the question
In order to leave comments, you need to log in
XMLHttpRequest sends an OPTIONS request before sending a request to another domain.
He, in turn, should answer with the title:
You can see my detailed answer on stackoverlow.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question