getContentType method

MediaType getContentType()
  • Return the MediaType media type of the body, as specified
    • by the Content-Type header.
    • Returns null when the content-type is unknown.

Implementation

MediaType getContentType() {
	String value = getFirst(HttpHeaders.CONTENT_TYPE);
	return (hasLength(value) ? new MediaType.parseMediaType(value) : null);
}