JSONをサーバーに送信し、その結果としてJSONを取得しようとしています。 ユーザー名とパスワードを送信し、トークンやその他のコンテンツを返すこと。Android HTTPRequestサイクル
これは、送信用のHTTPリクエストに対して行っている処理です。同じリクエストでコンテンツを取り戻すにはどうすればよいですか?
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost("http://192.168.1.5/temp/test.php");
List<NameValuePair> value = new ArrayList<NameValuePair>();
value.add(new BasicNameValuePair("Name", jsonStr));
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(value);
request.setEntity(entity);
HttpResponse res = client.execute(request);
String[] status_String=res.getStatusLine().toString().trim().split(" ");
//String hd=res.getFirstHeader("result").toString();
//System.out.println("Res=" + res);
Log.e("tag", ""+res.toString());
if(status_String[1].equals("200")){
isDataSent=true;