-1
いくつかのクラスは廃止予定ですので、以下のコードに相当するものを見つけようとしています。Android - Apacheの廃止されたクラスと同等です
try
{
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
}
catch (Exception e)
{
e.printStackTrace();
}
は、これまでのところ私はこれを書いたが、それは私が、私は何かが私の要求と間違っていると思うの例外を取得しています要求した後
HttpURLConnection httpUrlConnection = null;
try
{
URL mUrl = new URL(url);
httpUrlConnection = (HttpURLConnection) mUrl.openConnection();
httpUrlConnection.setRequestMethod("POST");
httpUrlConnection.connect();
is = new BufferedInputStream(httpUrlConnection.getInputStream());
httpUrlConnection.disconnect();
}
catch(Exception e)
{
e.printStackTrace();
}
を動作しません。
を 'httpUrlConnection.disconnect();'あなたは後に、あなたの入力ストリームに何が起こるかだと思いますか切断する? – njzk2