如何在Android中发送一个大的(>5MB)post参数(以及其他post参数)?
我正在使用
org.apache.http.client.methods.HttpPost
以及
BasicNameValuePair
发送后参数。
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(someURL);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("param1", "value1"));
nameValuePairs.add(new BasicNameValuePair("param2", hugeValue));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
httpclient.execute(httppost);
hugeValue
是一个非常大的字符串,我想从
InputStream
我读的时候就发。我该怎么做?