title: Error while extracting response for type [class java.lang.Object] and content type [text/html;charset=UTF-8] -Html Response extracting
body: <p>I am getting error in parsing a response from a rest template.
  Below is the attach code snippet:</p>
  <pre><code> UriComponents uriComponents =
                  UriComponentsBuilder.fromHttpUrl(someUrl).build();
          List&lt;HttpMessageConverter&lt;?&gt;&gt; messageConverters = new ArrayList&lt;&gt;();
          MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
          List&lt;MediaType&gt; mediaTypes = new ArrayList&lt;&gt;();
          mediaTypes.add(MediaType.TEXT_HTML);
          converter.setSupportedMediaTypes(mediaTypes);
          messageConverters.add(converter);
          restTemplate.setMessageConverters(messageConverters);
    ResponseEntity&lt;Object&gt; response = restTemplate.exchange(uriComponents.toUri(), HttpMethod.POST, payload, Object.class);
  </code></pre>
  <p>The exception I am receiving is:</p>
  <pre><code>Error while extracting response for type [class java.lang.Object] and content type [text/html;charset=UTF-8]
  
  org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character ('&lt;' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('&lt;' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
   at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 2]
  </code></pre>
  <p>Expected API response from the Postman I am retrieving is :
  <a href="https://i.stack.imgur.com/IJSxn.png" rel="nofollow noreferrer">click to view response</a></p>
  <p>Here in the response, the response is retrieving HTML content. How can I receive this response in the response of rest template I am triggering.</p>