블로그 이미지

calendar

1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
  • total
  • today
  • yesterday
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
posted by 천상의날개