title: How to post data with "Content-Type " header as "multipart/form-data"
body: <p>I am trying to post data using <code>multipart/form-data</code>, but  it is not working with httpPost method. I have to send data as json string from the API,but it is giving bad response from server if I remove <code>content-type</code> header, response says that do not ave permission to edit following data,
  I have to send 2 parameters from the API using <code>POST</code>,</p>
  
  <p>below is my code:</p>
  
  <pre><code>public String webPostMultiForm(List&lt;NameValuePair&gt; params) {
          String postUrl = webServiceUrl;
          httpPost = new HttpPost(postUrl);
          try {
              httpPost.setEntity(new UrlEncodedFormEntity(params));
              httpPost.addHeader("Cookie",appStatus.getSharedStringValue(appStatus.AUTH_KEY)); 
              httpPost.addHeader("Content-Type","multipart/form-data; boundary=assdsfdffafasf");
              httpPost.addHeader("Content-Disposition", "form-data; name= args");
              //httpPost.setHeader("Transfer-Encoding","chunked");
          } catch (UnsupportedEncodingException uee) {
              Log.e(TAG, uee.getMessage());
          }
          Log.e(TAG,"WebGetURL: " + postUrl);
          try {           
              response = httpClient.execute(httpPost);
          } catch (Exception e) {
              if (e.getMessage() != null) {
                  Log.e(TAG, "httpClient.execute(httpPost) Exception: " + e.getMessage());
              } else {
                  Log.e(TAG, "httpClient.execute(httpPost) Exception: " + e.getClass().toString());
              }
          }
          try {
              strResponse = EntityUtils.toString(response.getEntity());
          } catch (Exception e) {
              if (e.getMessage() != null) {
                  Log.e(TAG, e.getMessage());
              } else {
                  Log.e(TAG, e.getClass().toString());
              }
          }
          return strResponse;
      }
  </code></pre>
  
  <p>Is there anything I am doing wrong, or any other approach for this.</p>