title: Force spring RestTemplate to process plain text as JSON?
body: <p>A web API is responding to a request with <code>Content-Type:text/plain; charset=utf-8</code>, but the messageis formatted as if it were a JSON, eg.</p>
  
  <pre><code>{
  "total": 168,
  "page": 0,
  "pageCount": 1,
  ...
  }
  </code></pre>
  
  <p>In Spring, this message is processed with a RestTemplate and the JSON is automagically mapped into a <code>ModelDto</code> POJO,</p>
  
  <pre><code>restTemplate.getForObject(url, ModelDto::class.java) 
  </code></pre>
  
  <p>This gives the following error:</p>
  
  <blockquote>
    <p>org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class api.ModelDto] and content type [text/plain;charset=utf-8]</p>
  </blockquote>
  
  <p>Is there any way to have spring treat this message as if it were a JSON and parse it as such, despite the Content-Type being plaintext?</p>