title: How to use RestTemplate with application/octet-stream response type
body: <p>I am using a <a href="http://isbndb.com/api/v2/docs" rel="noreferrer">ISBNdB</a> to get info about the books.The reponse type is application/octet-stream. A sample json response I get looks as follows </p>
  
  <pre><code>{
  "index_searched" : "isbn",
  "data" : [
    {
       "publisher_id" : "john_wiley_sons_inc",
       "publisher_name" : "John Wiley &amp; Sons, Inc",
       "title_latin" : "Java programming interviews exposed",
       "language" : "eng",
       "summary" : "",
       "physical_description_text" : "1 online resource (xvi, 368 pages) :",
       "author_data" : [
          {
             "name" : "Markham, Noel",
             "id" : "markham_noel"
          },
          {
             "id" : "greg_milette",
             "name" : "Greg Milette"
          }
       ],
       "title_long" : "Java programming interviews exposed",
       "urls_text" : "",
       "publisher_text" : "New York; John Wiley &amp; Sons, Inc",
       "book_id" : "java_programming_interviews_exposed",
       "awards_text" : "; ",
       "subject_ids" : [],
       "isbn13" : "9781118722862",
       "lcc_number" : "",
       "title" : "Java programming interviews exposed",
       "isbn10" : "1118722868",
       "dewey_decimal" : "005.13/3",
       "edition_info" : "; ",
       "notes" : "\"Wrox programmer to programmer\"--Cover.; Acceso restringido a usuarios UCM = For UCM patrons only.",
       "marc_enc_level" : "",
       "dewey_normal" : "5.133"
    }
    ]
    }
  </code></pre>
  
  <p>I am using Jackson to convert this reponse. My Pojo looks as follows</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  
  public class value {
      private  String index_searched;
      // Another pojo in different file with ignore properties
      private data[] dat;
  
      public value(){
  
      }
      public data[] getDat() {
          return dat;
      }
  
      public void setDat(data[] dat) {
          this.dat = dat;
      }
      public String getIndex_searched() {
          return index_searched;
      }
      public void setIndex_searched(String index_searched) {
          this.index_searched = index_searched;
      } 
     }
  </code></pre>
  
  <p>When I tried following  </p>
  
  <pre><code>  value book = restTemplate.getForObject(FINAL_URL, value.class);
  </code></pre>
  
  <p>I get this exception</p>
  
  <pre><code>org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.rocketrenga.mylibrary.domain.value] and content type [application/octet-stream]
  </code></pre>
  
  <p>But I am able to map the response to String </p>
  
  <pre><code>String book = restTemplate.getForObject(FINAL_URL, String.class);
  ObjectMapper mapper = new ObjectMapper();
  value val = mapper.readValue(book, value.class);
  System.out.println(val.getIndex_searched());
  </code></pre>
  
  <p>How to go about mapping the response directly POJO instead of String and converting back to POJO</p>