title: How to send String[] As value of HashMap to REST
body: <p>I am trying to send a HashMap to Magento REST API From Android. The rest contain a array element as showing below.</p>
  
  <pre><code>[{
      "id": "26",
      "label": "",
      "position": "1",
      "exclude": "0",
      "url": "http:\/\/localhost\/magento\/media\/catalog\/product\/6\/1\/61UROlGlryL._UL1500_.jpg_20.jpg",
      "types": []
  }] 
  </code></pre>
  
  <p>I tried to send the data using <code>HttpPost</code> As showing below.</p>
  
  <pre><code>Map &lt; String, String &gt; productimages = new HashMap &lt; String, String &gt; ();
  
  productimages.put("file_mime_type", mime);
  productimages.put("file_content", encodedImage);
  productimages.put("file_name", pictureName);
  
  String[] datas = {
    "image", "small_image", "thumbnail"
  };
  productimages.put("types", datas.toString());
  Gson gson = new Gson();
  String productimages_json = gson.toJson(productimages);
  StringEntity productimages_entity = new StringEntity(productimages_json, HTTP.UTF_8);
  HttpPost httppost_img = new HttpPost(URL_PRODUCTS + "/6/images");
  httppost_img.setHeader("Content-Type", "application/json");
  httppost_img.setHeader("Accept", "application/json");
  httppost_img.setEntity(productimages_entity);
  Log.d("inserted", "");
  HttpResponse response_img = client.execute(targetHost, httppost_img, localContext);
  </code></pre>
  
  <p>All the data rather than "types":[ ] is hitting the web service. When send the data as single string like <code>productimages.put("types", "image");</code> it hit the web service Successfully But I need to send more than one value.Also I tried the following but no result.</p>
  
  <pre><code>Map&lt;String,String[]&gt; productimages = new HashMap&lt;String, String[]&gt;();
  String[] datas = {"image","small_image","thumbnail"};
  productimages.put("types", datas);
  </code></pre>
  
  <p>How I can send the String[] values with the single key to REST Web Service.Anyone please help me to solve this.</p>