Apache http component
description
Transcript of Apache http component
![Page 1: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/1.jpg)
자바카페와 함께하는
Apache HttpComponents
JavaCafe 김흥래
![Page 2: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/2.jpg)
발표자
김흥래NHN INS 경영지원개발팀에서그룹웨어를 개발하고 있습니다 .
자바카페 (JAVACAFE) 커뮤니티에서 운영진으로 활동하고 있습니다 .
![Page 3: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/3.jpg)
![Page 4: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/4.jpg)
APACHEHTTP COMPONETS Http 프로토콜 통신을 지원하는 자바 기반의 Component
Http 기반의 클라이언트 및 서버 프로그램 개발 가능 Web Spider, Http Proxy, Web Service System
HttpClient, HttpCore 라이브러리로 구성 2001 년부터 개발되기 시작한 안정화 된 라이브러리 Apache Commons 프로젝트에서 독립 프로젝트로 승격
![Page 5: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/5.jpg)
![Page 6: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/6.jpg)
![Page 7: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/7.jpg)
APACHE COMMONS LIBRARY 프로그램의 공통적인 기능을 재사용하기 위한 목적으로 시작 Google Library 와 더불어 전세계적으로 가장 많이 사용되고 있는
Library
현재 Commons Library 는 40 여개의 컴포넌트들로 구성 각각의 컴포넌트를 필요에 따라서 선택적으로 사용하는 것이 가능
![Page 8: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/8.jpg)
![Page 9: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/9.jpg)
![Page 10: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/10.jpg)
![Page 11: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/11.jpg)
![Page 12: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/12.jpg)
2005 년
![Page 13: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/13.jpg)
![Page 14: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/14.jpg)
![Page 15: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/15.jpg)
![Page 16: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/16.jpg)
![Page 17: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/17.jpg)
Http Client
Http Core
HTTP Component 는 크게 2 가지의 기능으로 구성되어 있다 .
![Page 18: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/18.jpg)
APACHEHTTP COMPONENTS HttpComponents Core
Low Level 의 HTTP 전송 컴포넌트 HTTP 기반의 Server 와 Client 구현 가능 Blocking I/O 와 Non-Blocking I/O 지원
HttpComponents Client
HttpCore 를 이용하여 구현한 HTTP 기반의 Client Blocking I/O 기반
HttpComponents AysncClient
HttpCore NIO 를 이용하여 구현한 HTTP 기반의 Client Non-Blockin I/O 기반 현재 Beta 버전임
Commons HttpClient (legacy)
과거 3.0 기준의 라이브러리
![Page 19: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/19.jpg)
HttpCore 라이브러리특징 Low Level HTTP 라이브러리 Blocking I/O 기반 기술 제공 Non-Blocking I/O 기반 기술 제공 HTTP 1.1 프로토콜 완벽 지원
![Page 20: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/20.jpg)
HttpCore 라이브러리모듈 HttpCore
Blocking I/O 기반의 Http 컴포넌트 httpcore-4.2.3.jar
HttpCore NIO
Non-Blocking I/O 기반의 Http 컴포넌트 httpcore-nio-4.2.3.jar
![Page 21: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/21.jpg)
HttpCore 라이브러리모듈
![Page 22: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/22.jpg)
HttpClient 라이브러리특징 HttpCore 를 기반으로 만든 Client-side HTTP 통신 라이브러리 모든 Http 메소드 구현 (GET, POST, PUT, DELETE, HEAD,
OPTIONS, TRACE)
Blocking I/O 기반의 동작방식을 가진다 .
HTTP 메시지를 전송 및 수신이 가능하다 .
손쉬운 Http Proxy 구성이 가능하다 .
Javascript 실행이 불가능하다 .
URI Redirect 동작이나 HTML 랜더링이 불가능하다 .
Web Browser 가 아니다 .
![Page 23: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/23.jpg)
HttpClient 라이브러리특징
![Page 24: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/24.jpg)
HttpClient 라이브러리특징
![Page 25: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/25.jpg)
HttpClient 라이브러리모듈 HttpClient
Client-side HTTP 통신 지원 httpclient-4.2.3.jar
HttpMime
HttpClient 모듈을 지원하기 위한 용도 MIME Encoding httpmime-4.2.3.jar
HttpClient Cache
HttpClient 모듈에 Cache 기능을 추가한 확장 모듈 Ehcache, Memcached httpclient-cache-4.2.3.jar
![Page 26: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/26.jpg)
HttpClient 라이브러리httpclient-4.2.3.jar
![Page 27: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/27.jpg)
HttpClient 라이브러리httpclient-4.2.3.jar
![Page 28: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/28.jpg)
HttpClient 라이브러리httpclient-4.2.3.jar
![Page 29: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/29.jpg)
![Page 30: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/30.jpg)
![Page 31: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/31.jpg)
![Page 32: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/32.jpg)
HttpClient 라이브러리httpmime-4.2.3.jar
![Page 33: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/33.jpg)
HttpClient 라이브러리httpmime-4.2.3.jar
![Page 34: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/34.jpg)
HttpClient 라이브러리httpmime-4.2.3.jar
![Page 35: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/35.jpg)
HttpClient 라이브러리httpmime-4.2.3.jar
![Page 36: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/36.jpg)
HttpClient 라이브러리httpmime-4.2.3.jar
![Page 37: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/37.jpg)
![Page 38: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/38.jpg)
HttpClient 라이브러리httpclient-cache-4.2.3.jar
![Page 39: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/39.jpg)
HttpClient 라이브러리httpclient-cache-4.2.3.jar
![Page 40: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/40.jpg)
HttpClient 라이브러리httpclient-cache-4.2.3.jar
![Page 41: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/41.jpg)
![Page 42: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/42.jpg)
Http Proxy원리
![Page 43: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/43.jpg)
Http Proxy원리
![Page 44: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/44.jpg)
Http Proxy원리
![Page 45: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/45.jpg)
Http Proxy구현 Java URLConnection
Apache HttpClient 3.x
Apache HttpClient 4.x
![Page 46: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/46.jpg)
Http Proxy구현 Java URLConnection
JDK 기본 API java.net.HttpURLConnection Since : JDK 1.1
![Page 47: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/47.jpg)
Http Proxy구현 Java URLConnection
![Page 48: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/48.jpg)
Http Proxy구현 Apache HttpClient 3.x
HTTP 통신 라이브러리 Java URLConnection 보다 강력한 기능을 제공
Cookie 핸들링 Http Pipelining 지원
현재 개발 중단
![Page 49: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/49.jpg)
Http Proxy구현 Apache HttpClient 3.x
![Page 50: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/50.jpg)
Http Proxy구현 Apache HttpClient 4.x
HttpCore 와 HttpClient 분리 기존 3.x 버전과 하위 호환성 없음 Non-Blocking I/O 지원 Proxy Cache 지원
![Page 51: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/51.jpg)
HTTP COMPONENT사용예
![Page 52: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/52.jpg)
HTTP COMPONENT사용예
![Page 53: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/53.jpg)
HTTP COMPONENT사용예
![Page 54: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/54.jpg)
HTTP COMPONENT사용예
![Page 55: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/55.jpg)
HTTP COMPONENT사용예
![Page 56: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/56.jpg)
HTTP COMPONENT사용예
![Page 57: Apache http component](https://reader034.fdocument.pub/reader034/viewer/2022051412/548c9694b47959eb548b48bf/html5/thumbnails/57.jpg)