1
次のコードでHttpClient
を使用してサーバーにデータを送信しようとしています。長いURIを持つAndroid HttpPost
new Thread(new Runnable() {
@Override
public void run() {
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(URL_PREFIX + "?" + URLEncodedUtils.format(nameValuePairs, "utf-8"));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}).start();
が、私は、私は404エラーコードを取得し、サーバーにこのデータをポストしようとすると、要求が失敗したと私はブラウザを使用してリンクをチェックしようとしたとき、私は、次を得ます。
Request-URI Too Long
The requested URL's length exceeds the capacity limit for this server.
Additionally, a 414 Request-URI Too Long error was encountered while trying to use an ErrorDocument to handle the request.
when check my httppost uri link length was 3497 char.
私のコードでは、base64でエンコードされた画像とその他のパラメータを送信しようとしています。誰も私がこれを解決するのを助けることができますか?またはそれを達成するための他の方法?