Hi All,

I am trying to test a rest api hosted in a different domain using swagger
ui.
This swagger ui is hosted in my local machine with Apache tomcat.

Now, when i try to access a rest api hosted in a different machine using
'Try it out' button in swagger ui, it gives 'error": "no response from
server"

In chrome debug window, I can see this message "XMLHttpRequest cannot load
http://XX.XX.XX.XX:83/MyRestAPI. Response to preflight request doesn't pass
access control check: No 'Access-Control-Allow-Origin' header is present on
the requested resource. Origin 'http://localhost:8080' is therefore not
allowed access.

In Network console, I am getting the expected response :200.

I tried adding CORS filter in my Tomcat web.xml, but it does not work.

Is there any way to add "Access-Control-Allow-Origin" in the request header
?

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to