title: How to log restassured request data to testNG report file
body: <p>I want to log request data which gets printed in console to testNG report file using testNG's Reporter.log() method which expects string input. Below is my request specification:</p>
  
  <pre><code>private RequestSpecification getRequestSpec(ContentType requestbodytype, ContentType responsetype) {
  
      return  RestAssured.given().log().everything().contentType(requestbodytype).accept(responsetype);
  }
  protected Response get(String resourceURI, ContentType requestbodytype, ContentType responsetype, boolean enableUrlEncoding) {
  
      Response rs = null;
      rs = getRequestSpec(requestbodytype, responsetype).when().get(resourceURI);
      Reporter.log(rs.print());
      return rs;
  }
  </code></pre>
  
  <p>I want to log below content to testing log file along with response which I will receive upon exection of this call</p>
  
  <pre><code>Request method: GET
  Request URI:    http://localhost:port/url
  Proxy:          &lt;none&gt;
  Request params: &lt;none&gt;
  Query params:   &lt;none&gt;
  Form params:    &lt;none&gt;
  Path params:    &lt;none&gt;
  Headers:        Accept=application/json, application/javascript, text/javascript
                  Content-Type=application/json; charset=UTF-8
  Cookies:        &lt;none&gt;
  Multiparts:     &lt;none&gt;
  Body:           &lt;none&gt;
  </code></pre>
  
  <p>Can anyone please help me to resolve this.</p>
  
  <p>Thanks</p>