title: How to follow the redirect in rest assured?
body: <p>I have a spring boot application and a controller will redirect to a page based on the post parameter.<br>
  And I am creating the test case which want to assert the redirect page
  But I failed to get the redirected html from the rest assured response</p>
  
  <pre><code>    @Test
      public void test() throws Exception {
  
          Response response = given()
              .param("name", "myName")
          .when()
              .redirects().follow(true).redirects().max(100)
              .post("/myPath");      // it will redirect to another page
  
  
          // I want to print from &lt;html&gt; to &lt;/html&gt; of the redirected page
          System.out.println("returned full html /n" + response.getBody().asString());  
      }
  </code></pre>
  
  <p>I receive 302 and the location of the redirect page in the response header.</p>
  
  <pre><code>11:38:03.291 [main] DEBUG org.apache.http.headers - &lt;&lt; "Location: http://localhost:8080/myRedirectPage[\r][\n]"
  .........
  11:38:03.291 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Receiving response: HTTP/1.1 302 
  11:38:03.291 [main] DEBUG org.apache.http.headers - &lt;&lt; HTTP/1.1 302 
  </code></pre>