mulesoft / api-designer

A web editor for creating and sharing RAML API specifications
Other
1.07k stars 269 forks source link

Any request to the real API results in a 404 #192

Closed igorkosta closed 10 years ago

igorkosta commented 10 years ago

We've captured the POST request coming from API-Designer with fiddler and realised that it was an OPTIONS request. Doesn't matter what request we define in our .raml document - the only request API-Designer is sending is the OPTIONS request.

dmartinezg commented 10 years ago

Hi @igorkosta, you are pretty much describing CORS issues in your API.

In case you are not aware of what CORS is:

Due to security constraints, web browsers (and web services) do not allow web applications to reach a web services unless they are hosted in the same domain. To allow Cross Origin HTTP requests, web browsers make a special request (that OPTIONS request is called "preflight request") to the Web service, using some custom HTTP headers to find out if it is allowed to make the actual web service call, based on the server's response, the web browser then makes the actual HTTP request. This is all handled by the web browser automatically, so there's nothing we can do in the API-designer.

Solutions:

igorkosta commented 10 years ago

Hi @dmartinezg, thank you very much for such a detailed answer!

igorkosta commented 10 years ago

Hi @dmartinezg, do you know, how can we "teach" API-Designer to use the proxy hosted on the same server as the API-Designer itself. The only thing we can configure is the baseUri in our .raml document.

Thank you for your help in advance!