title: Okhttp convert Response to Spring ResponseEntity
body: <p>I have a Springboot 2.2 webservice with a POST REST api.
  I am using Okhttp client to make the request to a third party service.
  I want to return the exact response from the third party service to the caller of my webservice.
  All the okhttp recipes refer to:</p>
  
  <pre><code> if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
  
        System.out.println(response.body().string());
  </code></pre>
  
  <p>I have tried returning the okhttp Response in my api but I only return to the caller example:</p>
  
  <pre><code>{
      "redirect": false,
      "successful": true
  } 
  </code></pre>
  
  <p>So it does not insert the message returned from the third party service.</p>
  
  <p>Does anyone know how to convert Okhttp Response object to a Spring ResponseEntity object so that I may return the <strong>http response code and message</strong> </p>