Skip to content

Instantly share code, notes, and snippets.

@jhiemer
Created September 2, 2012 17:00
Show Gist options
  • Save jhiemer/3601503 to your computer and use it in GitHub Desktop.
Save jhiemer/3601503 to your computer and use it in GitHub Desktop.
MediaType acceptType = config.getDefaultMediaType();
HttpMessageConverter converter = findWriteConverter(resource.getClass(), acceptType);
// If an Accept header is specified that isn't the catch-all, try and find a converter for it.
if(null == converter) {
for(MediaType mt : request.getHeaders().getAccept()) {
if(MediaType.ALL.equals(mt)) {
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment