Hi,
I created a microservice using MSF4J and tested the resources with postman
all works fine but when I use it with a AngularJS client app; the browser
sends an additional http OPTIONS request to check CORS I get a "405 Method
Not Allowed" Response.
I created a resource with @OPTIONS (javax.ws.rs) annotation to the same
path still the same result, 405 response, the method doesn't even get
triggered.
@OPTIONS
@Path("/")
public Response options() {
return Response.ok()
.header("Access-Control-Allow-Origin", "*")
.header("Access-Control-Allow-Credentials", "true")
.header("Access-Control-Allow-Methods", "POST, GET, PUT,
UPDATE, DELETE, OPTIONS, HEAD")
.header("Access-Control-Allow-Headers", "Content-Type,
Accept, X-Requested-With")
.build();
}
I think the http OPTIONS request is not recognized.
For your advise please.
Thank You,
Best Regards,
--
Janak Amarasena
*Intern*
*WSO2, Inc. *
*lean . enterprise . middleware *
*Mobile: +94777764144 <%2B94777764144>*
*Email: *[email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev