public void getSession() throws Exception{
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(http://싸이트);
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("monitorid", "아이디"));
nameValuePairs.add(new BasicNameValuePair("password", "비밀번호"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
}
예제만 보고 따라해보려고 하니까 잘 모르겠네요. 위 소스로 코딩 하면 세션이 연결되는건가요?
세션이 연결됐다라고 하면 해당 어플이 실행중인 동안은 그 세션이 유지가 되는건가요? 아니면
연결 직후 하는 액션에 대해서만 세션이 연결되는건지도 알려주시면 감사하겠습니다.
이쪽 관련된 예제 알고 계시면 알려주시면 감사 하겠습니다.