http://jakarta.apache.org/commons/httpclient/

바이너리 다운로드 : http://ftp.apache-kr.org/jakarta/commons/httpclient/binary/commons-httpclient-3.0.1.tar.gz 

셋업 : ../WEB-INF/lib/ 에 commons-httpclient-3.0.1.jar 파일 넣어주고 톰캣 리스타트.


API : http://jakarta.apache.org/commons/httpclient/apidocs/


** 추가 **
httpclient 만 올려주니깐  commons codec 이 없다고 에러가 났다.
그래서, commons codec 도 다운받아서 올려줌.

http://jakarta.apache.org/commons/codec/

바이너리 다운로드 : http://ftp.apache-kr.org/jakarta/commons/codec/binaries/commons-codec-1.3.tar.gz

셋업 : ../WEB-INF/lib/ 에 commons-codec-1.3.jar 파일 올려주고 톰캣 리스타트.


** 추가2 -_- **
HttpClient 는 Commons Logging 컴포넌트도 필요하다고 한다 -_-;
Commons Logging 없이 그냥 실행시켜도 돌아가는것 같은데,, 혹시 모르니
이 넘도 올려준다.
나의 경우 /usr/local/tomcat/common/lib/ 에 이미 깔려져 있어서 스킵했음.

http://jakarta.apache.org/commons/logging/

바이너리 다운로드 : http://ftp.apache-kr.org/jakarta/commons/logging/binaries/commons-logging-1.1.tar.gz







// 샘플
HttpClient client = new HttpClient();
client.setConnectionTimeout(1000);
client.setTimeout(3000);
HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(host, port); // 접속할 서버
PostMethod method = new PostMethod(uri); // 요청할 URI
method.addRequestHeader("Content-Type", "text/html; charset=EUC-KR");
method.setParameter(key, value); // 전달할 key, value
client.executeMethod(hostConfig, method);
String response = new String(method.getResponseBody(), "EUC-KR");  // 응답메시지
method.releaseConnection();
return response;

Creative Commons License
Creative Commons License

'정리안된 폴더' 카테고리의 다른 글

AMOLED 관련 메모  (0) 2007/02/22
Jakarta Commons HttpClient  (0) 2006/08/29
Posted by 재임스진
◀ PREV : [1] : ... [21] : [22] : [23] : [24] : [25] : [26] : [27] : [28] : [29] : ... [31] : NEXT ▶

BLOG main image
재임스진 블로그

공지사항

카테고리

전체보기 (31)
바람이 불어오는 곳 (2)
인터넷 중독 (10)
책은 슬램덩크가 최고 (2)
영화 볼 땐 카라멜팝콘 (2)
또 하루 멀어져간다 (5)
잼스진의 호작질 (4)
호모 컨슈머 (4)
정리안된 폴더 (2)

글 보관함

달력

«   2010/03   »
  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 29 30 31      
Statistics Graph
Total : 120,692
Today : 0 Yesterday : 6