Skip to content

Instantly share code, notes, and snippets.

@rankun203
Last active December 26, 2015 18:09
Show Gist options
  • Save rankun203/7192478 to your computer and use it in GitHub Desktop.
Save rankun203/7192478 to your computer and use it in GitHub Desktop.
获取支持的MediaType
RestTemplate tpl = new RestTemplate();
List cvts = tpl.getMessageConverters();
for (int i = 0; i < cvts.size(); i++) {
List smts = ((HttpMessageConverter)cvts.get(i)).getSupportedMediaTypes();
for (int j = 0; j < smts.size(); j++) {
System.err.println(smts.get(j));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment