title: [Java][RestAssured] How to save application/octet-stream response as jpg image?
body: <p>I want to download images from website using RestAssured. My code:</p>
  
  <pre><code>Response response = given()
              .log().all()
              .cookie(cookie)
              .get(format(image_endpoint, "46581657"));
  </code></pre>
  
  <p>Endpoint returns status code 200 and image in "application/octet-stream" type. How can I save it as jpg file?</p>
  
  <p>I have tried:</p>
  
  <pre><code>String bin = getImageResponse()
              .prettyPrint();
      saveFile("foto.jpg", bin); //this method only save string to file
  </code></pre>
  
  <p>But I cannot open jpg file. How can I save it?</p>