title: Does OkHttp have something easier similar to Unirest's field method for creating a RequestBody?
body: <p>Instead of <code>Unirest</code>, I'm using okhttp because there are responses where I only need the header so I don't need to download it using its <code>ResponseBody.string()</code> method.</p>
  
  <p>I am however having a hard time building my requests for <code>POSTs</code> with a <code>RequestBody</code>. In <code>Unirest, you only need to use the</code>field<code>method to add to the its</code>RequestBody`:</p>
  
  <pre><code>Unirest.post(baseUrl + "/api/user")
                  .header("Authorization", token)
                  .field("id", id)
                  .field("property", property)
                  .asJson();
  </code></pre>
  
  <p>But in <code>OkHttp</code>, if I want to add a <code>RequestBody</code> I have to do this (in most cases where I don't really have a <code>json</code> lying around):</p>
  
  <pre><code>OkHttpClient httpClient = new OkHttpClient();
  Map&lt;String, Object&gt; payload = new HashMap&lt;&gt;();
  payload.put("user_id", userId);
  payload.put("client_id", clientId); 
  payload.put("type", status.getStatus());
  payload.put("description", ""); 
  payload.put("duration", 0); 
  
  String requestBody = new ObjectMapper().writeValueAsString(payload);
  
  Call call = httpClient.newCall(
          new Request.Builder()
  
                  .url(url) 
                  .header("Authorization", tempToken)
                  .post(RequestBody.create(MediaType.get("application/json"), requestBody))
                  .build()
  );
  </code></pre>
  
  <p>I'm using a <code>Map</code> to create a <code>json</code> string because this is the easiest way for me to create a <code>json</code>.</p>
  
  <p>Does <code>OkHttp</code> have something easier similar to <code>Unirest</code>'s <code>field</code> method for creating a RequestBody?</p>