apache http component

57
자자자자자 자자자자 Apache HttpComponents JavaCafe 자자자

Upload: -

Post on 14-Dec-2014

603 views

Category:

Education


2 download

DESCRIPTION

2013년 공감세미나에서 발표한 내용입니다.

TRANSCRIPT

Page 1: Apache http component

자바카페와 함께하는

Apache HttpComponents

JavaCafe 김흥래

Page 2: Apache http component

발표자

김흥래NHN INS 경영지원개발팀에서그룹웨어를 개발하고 있습니다 .

자바카페 (JAVACAFE) 커뮤니티에서 운영진으로 활동하고 있습니다 .

Page 3: Apache http component
Page 4: Apache http component

APACHEHTTP COMPONETS Http 프로토콜 통신을 지원하는 자바 기반의 Component

Http 기반의 클라이언트 및 서버 프로그램 개발 가능 Web Spider, Http Proxy, Web Service System

HttpClient, HttpCore 라이브러리로 구성 2001 년부터 개발되기 시작한 안정화 된 라이브러리 Apache Commons 프로젝트에서 독립 프로젝트로 승격

Page 5: Apache http component
Page 6: Apache http component
Page 7: Apache http component

APACHE COMMONS LIBRARY 프로그램의 공통적인 기능을 재사용하기 위한 목적으로 시작 Google Library 와 더불어 전세계적으로 가장 많이 사용되고 있는

Library

현재 Commons Library 는 40 여개의 컴포넌트들로 구성 각각의 컴포넌트를 필요에 따라서 선택적으로 사용하는 것이 가능

Page 8: Apache http component
Page 9: Apache http component
Page 10: Apache http component
Page 11: Apache http component
Page 12: Apache http component

2005 년

Page 13: Apache http component
Page 14: Apache http component
Page 15: Apache http component
Page 16: Apache http component
Page 17: Apache http component

Http Client

Http Core

HTTP Component 는 크게 2 가지의 기능으로 구성되어 있다 .

Page 18: Apache http component

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

HttpCore 라이브러리특징 Low Level HTTP 라이브러리 Blocking I/O 기반 기술 제공 Non-Blocking I/O 기반 기술 제공 HTTP 1.1 프로토콜 완벽 지원

Page 20: Apache http component

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

HttpCore 라이브러리모듈

Page 22: Apache http component

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

HttpClient 라이브러리특징

Page 24: Apache http component

HttpClient 라이브러리특징

Page 25: Apache http component

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

HttpClient 라이브러리httpclient-4.2.3.jar

Page 27: Apache http component

HttpClient 라이브러리httpclient-4.2.3.jar

Page 28: Apache http component

HttpClient 라이브러리httpclient-4.2.3.jar

Page 29: Apache http component
Page 30: Apache http component
Page 31: Apache http component
Page 32: Apache http component

HttpClient 라이브러리httpmime-4.2.3.jar

Page 33: Apache http component

HttpClient 라이브러리httpmime-4.2.3.jar

Page 34: Apache http component

HttpClient 라이브러리httpmime-4.2.3.jar

Page 35: Apache http component

HttpClient 라이브러리httpmime-4.2.3.jar

Page 36: Apache http component

HttpClient 라이브러리httpmime-4.2.3.jar

Page 37: Apache http component
Page 38: Apache http component

HttpClient 라이브러리httpclient-cache-4.2.3.jar

Page 39: Apache http component

HttpClient 라이브러리httpclient-cache-4.2.3.jar

Page 40: Apache http component

HttpClient 라이브러리httpclient-cache-4.2.3.jar

Page 41: Apache http component
Page 42: Apache http component

Http Proxy원리

Page 43: Apache http component

Http Proxy원리

Page 44: Apache http component

Http Proxy원리

Page 45: Apache http component

Http Proxy구현 Java URLConnection

Apache HttpClient 3.x

Apache HttpClient 4.x

Page 46: Apache http component

Http Proxy구현 Java URLConnection

JDK 기본 API java.net.HttpURLConnection Since : JDK 1.1

Page 47: Apache http component

Http Proxy구현 Java URLConnection

Page 48: Apache http component

Http Proxy구현 Apache HttpClient 3.x

HTTP 통신 라이브러리 Java URLConnection 보다 강력한 기능을 제공

Cookie 핸들링 Http Pipelining 지원

현재 개발 중단

Page 49: Apache http component

Http Proxy구현 Apache HttpClient 3.x

Page 50: Apache http component

Http Proxy구현 Apache HttpClient 4.x

HttpCore 와 HttpClient 분리 기존 3.x 버전과 하위 호환성 없음 Non-Blocking I/O 지원 Proxy Cache 지원

Page 51: Apache http component

HTTP COMPONENT사용예

Page 52: Apache http component

HTTP COMPONENT사용예

Page 53: Apache http component

HTTP COMPONENT사용예

Page 54: Apache http component

HTTP COMPONENT사용예

Page 55: Apache http component

HTTP COMPONENT사용예

Page 56: Apache http component

HTTP COMPONENT사용예

Page 57: Apache http component