title: How do you send checkbox data in Jsoup
body: <p>I am trying to post checkbox data with Jsoup and am having a little trouble. I thought that when multiple checkboxes are selected, they are sent as an array to the server but maybe that is not the case?</p>
  
  <p>This is what I thought was correct:</p>
  
  <pre><code>HashMap&lt;String, String&gt; postData = new HashMap&lt;String, String&gt;();
  postData.put("checkbox", "[box1,box2,box3]");
  
  Jsoup.connect("somesite").data(postData).post();
  </code></pre>
  
  <p>This does not seem to work properly. However, if I send only a single checkbox then I get my expected results leading me to believe my understanding of how checkbox form data sends is incorrect.</p>
  
  <p>This works:</p>
  
  <pre><code>postData.put("checkbox", "box2");
  </code></pre>
  
  <p>Maybe HashMap is the wrong type to use. According to the Jsoup <a href="http://jsoup.org/apidocs/org/jsoup/Connection.html#data%28java.lang.String,%20java.lang.String%29" rel="nofollow">documentation</a> I could just call .data(key, value) multiple times but I was hoping for something a little cleaner than that.</p>