I am trying make a JSON call to a server using HttpClient API. The code sinppet is shown below.
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpPost = new HttpPost(URLString);
HttpResponse response = httpClient.execute(httpPost);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("method", "completeUserLogin"));
String[] params = new String[]{"100408"};
response = httpClient.execute(httpPost);
I want to add params to nameValuePairs. BasicNameValuePair class does not allow you to add arrays. Any thoughts?
Thanks in advance!