こんにちは:)単純な問題が発生しましたが、非常に面倒です。HttpPost クラスを使用して http 投稿リクエストを送信しようとしています
これは、InputStream を返すメソッドの一部です。
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url+path);
ArrayList<NameValuePair> paramsList = new ArrayList<NameValuePair>();
paramsList.add(new BasicNameValuePair("key1", value1));
paramsList.add(new BasicNameValuePair("key2", value2));
paramsList.add(new BasicNameValuePair("key3", value3));
httpPost.setEntity(new UrlEncodedFormEntity(paramsList));
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
InputStream is = httpEntity.getContent();
return is;
しかし、問題はサーバーにあります。サーバーは、POST ではなく GET リクエストを送信していると「考える」ためです。問題は、どこが間違っているかです。他のアプリケーションでコードの同様の部分を使用していますが、正常に動作します。
乾杯。:)