This will work:

@RequestMapping(value = "/test", method = RequestMethod.POST,
    headers = {"content-type=application/json"}) {
    .......
}

If I add another value to it like the following, then it will fail and tell me this:

The specified HTTP method is not allowed for the requested resource (Request method 'POST' not supported)

@RequestMapping(value = "/test", method = RequestMethod.POST,
    headers = {"content-type=application/json","content-type=application/xml"}) {
    .......
}


I guess this is because Spring thinks the two content type values have "AND" relationship but instead I want them to be "OR".

Any suggestions?

Thanks!

Edit
Report