0
投稿方法を使用してユーザ名とパスワードを送信してURLへの投稿をしようとしていますが、答えは不明です。ここでhttpサーバからの応答を得ることができません
は、私はそれを行う方法です。
HttpClient httpclient =new DefaultHttpClient();
HttpPost httppost=new HttpPost("http://test.res-novae.fr/xperia_orange/scripts/android_ckeck_user.php");
try{
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("id", "12345"));
nameValuePairs.add(new BasicNameValuePair("stringdata", "AndDev is Cool!"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
/*Checking response*/
if(response!=null)
{
InputStream in = response.getEntity().getContent();
System.out.println("Resultat de la server:"+in);
}
}
catch(ClientProtocolException e)
{
}
catch (IOException e) {
// TODO Auto-generated catch block
}
、これは、サーバからの応答です:
Resultat de la server:[email protected]
私が間違ってやっている人を知っていますか?
私はそれを行った:)...とにかく感謝;) – adrian