• No replies
4 Posts

Pinned topic How can I add CORS support to my REST API in WAS Liberty

‏2013-12-11T12:25:30Z | cors

How do I enable CORS support for my REST API?


I assume I need to use Apache Wink HandlersFactory and ResponseHandler?

import org.apache.wink.server.handlers.HandlersFactory;

import org.apache.wink.server.handlers.ResponseHandler;

httpResponse.setHeader("Access-Control-Allow-Origin", "*");
httpResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");

I couldn't get the above to work so any examples tips appreciated.