2010. 8. 5. 16:00
JAVA언어
서버 환경
[Tomcat 5.5, encoding이 utf-8일때 ]
HttpMethodBase method = new PostMethod("url...");
method.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
method.addParameter("teamname", "마이팀");
HttpClient client = new HttpClient();
client.executeMethod(method);
byte[] responseMsg = method.getResponseBody();
System.out.println(new String(responseMsg ,"utf-8")); //응답받아온 것을 보려면 utf-8로 인코딩해서 봐야한다
'JAVA언어' 카테고리의 다른 글
CharSet 구조 (0) | 2010.08.15 |
---|---|
이클립스 실행시 워크스페이스 지정 (0) | 2010.08.14 |
properties 파일관리클레스 (0) | 2010.08.04 |
Java 자료형과 동기화 방법. (0) | 2010.05.11 |
한글깨짐 get,post 참조 (0) | 2010.03.31 |