I am getting an unsupported Media type (status code of 415).
I know why this is happening but am looking for an alternate solution to it.I have seen the answers where you change the header but for this customer that seems to be a difficulty.
The sender is a rest call from another company application. They don't set the Accept:application/json in the sending header. I know that this is why the call is failing.
I know that for this to work they should set this header. However, they are reluctant to do so.
My endpoint is as follows:
@RestController
@RequestMapping(value = "/keycontentprovider")
public class KMSKeyContentProviderController {
@Autowired
private KeyContentProviderService keyContentProviderService;
@RequestMapping(
value = "/generate",
method = RequestMethod.POST)
public ResponseEntity<?> generateContentKey(@RequestBody final KeyGenerateRequestDTO keyGenerateRequestDTO,
@RequestParam(value = "contentType", required = true) String contentType,
@RequestParam(value = "streamingProtocol", required = true) String streamingProtocol,
@RequestParam(value = "encryptionAlgorithm", required = true) String encryptionAlgorithm) {
return keyContentProviderService.generateKey(keyGenerateRequestDTO.getRequest(), contentType, streamingProtocol, encryptionAlgorithm);
}
}
I have tried to put various types of consumes="" in the RequestMapping definition but no luck.
The customer really doesn't want to change their code (even though they shoudl). Anyway that I can get around this?