title: how to request XML content type from rest-assured
body: <p>I have a REST api that supports json and xml. I would like to test the XML side but since upgreading to version 2.4.0 I am getting an error:</p>
  
  <p>Expected content-type "XML" doesn't match actual content-type "application/json".</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;com.jayway.restassured&lt;/groupId&gt;
              &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
              &lt;version&gt;2.4.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.jayway.restassured&lt;/groupId&gt;
              &lt;artifactId&gt;json-path&lt;/artifactId&gt;
              &lt;version&gt;2.4.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.jayway.restassured&lt;/groupId&gt;
              &lt;artifactId&gt;xml-path&lt;/artifactId&gt;
              &lt;version&gt;2.4.0&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>here are some test code samples that fail the tests.</p>
  
  <pre><code>    RequestSpecification requestSpec = new RequestSpecBuilder()
              .setContentType("application/xml")
              .build();
  
      expect()
              .contentType(ContentType.XML)
              .statusCode(200)
              .given()
              .spec(requestSpec)
              .get("/resources/main/dictionaries");
  </code></pre>
  
  <p>I also tried to set the content type directly on the given()</p>
  
  <pre><code>    given()
              .contentType("application/xml")
              .expect()
              .contentType(ContentType.XML)
              .statusCode(404)
              .get("/resources/main/revisions/10000");
  </code></pre>
  
  <p>how do I force the request to get XML media type?</p>
  
  <p>request log looks like this:</p>
  
  <pre><code>Request method: GET
  Multiparts:             &lt;none&gt;
  Headers:                Accept=*/*
                              Content-Type=application/xml; charset=ISO-8859-1
  Body:                   &lt;none&gt;
  </code></pre>