title: How to post x-www-urlencode request by rest assured
body: <p>I have a post request where i need to send x-www-form-urlencoded keyValue pair parameters and content-type should be x-www-form-urlencoded.</p>
  
  <p>Before coding ,i've tried in postman successfully,just adding Header"Content-Type=application/x-www-form-urlencoded" with x-www-form-urlencoded body .</p>
  
  <p>Here is my code:`       </p>
  
  <pre><code> RestAssured.baseURI="****"
          RequestSpecification request = RestAssured.given().config(RestAssured.config()
                  .encoderConfig(EncoderConfig.encoderConfig()
                  .encodeContentTypeAs("x-www-form-urlencoded",
                   ContentType.URLENC)))
                  .contentType(ContentType.URLENC.withCharset("UTF-8"))
                  .formParam("grant_type", *)
                  .formParam("code", *)
                  .formParam("client_id",*)
                  .when().log().all()
                  .then().log().all().request()
          request.post("/oauth2/token")`
  </code></pre>
  
  <p>I guess rest assured posted as formParam not "x-www-form-urlencoded"?
  This is rest assured log: `</p>
  
  <pre><code>Request method: POST
  Request URI:    ***
  Proxy:          &lt;none&gt;
  Request params: &lt;none&gt;
  Query params:   &lt;none&gt;
  Form params:    grant_type=***
                  code=***
                  client_id=***
  Path params:    &lt;none&gt;
  Headers:        Accept=image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap
                  Content-Type=application/x-www-form-urlencoded; charset=UTF-8
  Cookies:        &lt;none&gt;
  Multiparts:     &lt;none&gt;
  Body:           &lt;none&gt;
  HTTP/1.1 405 Method Not Allowed
  Content-Length: 61
  Date: Tue, 30 Jan 2018 06:59:20 GMT
  X-Correlationid: 5d155b6f-0d85-4775-5f50-82c397e5b44b
  X-Smp-Log-Correlation-Id: 5d155b6f-0d85-4775-5f50-82c397e5b44b
  X-Vcap-Request-Id: 5d155b6f-0d85-4775-5f50-82c397e5b44b
  Only support Content-Type：application/x-www-form-urlencoded
  </code></pre>
  
  <p>`
  This problem drives me crazy for a couple f days  .
  Please do let me know is there any other way to send x-www-form-urlencoded parameters or some updation required in code.</p>
  
  <p>Thanks a lot!</p>