Answer the question
In order to leave comments, you need to log in
How to implement rest api between different domains?
Hello!
From the side of the server where I want to turn, cross-domain calls are prohibited. How can I implement a request to this server differently?
At the moment I'm getting an error. No 'Access-Control-Allow-Origin' header is present on the requested resource.
Thank you very much in advance!
Answer the question
In order to leave comments, you need to log in
There is a fetch(url, options) function. It takes as the first parameter the url where to send. Using the `http:\\${domain}\${api}\...` construct, you can dynamically substitute endpoint URLs. The second parameter is the type options that will be in the Header and more. And you can pass an instance of Request as one parameter.
Read more on MDN
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question