title: How do I post data using okhttp library with content type x-www-form-urlencoded?
body: <p>I have used this method <a href="https://stackoverflow.com/a/31744565/5829906">https://stackoverflow.com/a/31744565/5829906</a> but doesnt post data.</p>
  
  <p>Here is my code</p>
  
  <pre><code> OkHttpClient client = new OkHttpClient();
          RequestBody requestBody = new MultipartBuilder()
                  .type(MultipartBuilder.FORM)
                  .addFormDataPart("rating", "5").addFormDataPart("comment", "Awesome")
                  .build();
          Request request = new Request.Builder()
                  .url(url)
                  .post(requestBody)
                  .build();
          try {
  
              Response response = client.newCall(request).execute();
              String responseString = response.body().string();
              response.body().close();
          }catch (Exception e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I tried DefaultHttpClient , that seems to be working, but it shows deprecated, so thought of trying something different..Cant figure out what is wrong in this</p>