ibm dwlive, "internet & http - 잃어버린 패킷을 찾아서..."
TRANSCRIPT
1990 2009
그림출처 - http://en.wikipedia.org
HTTP
HTML(5?)CSS
Javascript/AjaxJavascript Library
CometFlash/Flex
RoR, DjangoPHP, Servlet/JSP,
ASP…
2
1
1-1-1 1-1-2
1-1
1-2-1 1-2-2
1-2
3
HTTP
WWW Server-SideScripts
…
javascriptAjax
Comet…
기타 기술들… (아악!)
4
GET / HTTP/1.1Host: 127.0.0.1:8080User-Agent: Mozilla/5.0 …Accept: text/html,application/xml;…Accept-Language: ko-kr,ko;q=0.8,en-usAccept-Encoding: gzip,deflateAccept-Charset: EUC-KR,utf-8;q=0.7,*;q=0.7Keep-Alive: 300Connection: keep-alive
1
HTTP Request
5
HTTP/1.1 200 OKServer: Apache-Coyote/1.1Accept-Ranges: bytesETag: W/"331-1259569714921"Last-Modified: Mon, 30 Nov 2009 08:28:34 GMTContent-Type: text/htmlContent-Length: 331Date: Mon, 30 Nov 2009 08:32:30 GMT
<html><head><title>IBM PetchaKucha</title></head><body>Hello Web World!<hr/><font color="red" size="10"> 안녕하세요</font></body></html>
2
6
HTTP Response
<html><body>
<img src="images/h.png" /><img src="images/t.png" /><img src="images/t.png" /><img src="images/p.png" />
</body></html>
http://jqueryui.com/themeroller/images/?new=2e83ff&w=256&h=240&f=png&fltr[]=rcd|256&fltr[]=mask|icons/icons.png
(ex) jQuery UI
많은 Resource들
7
GET /wicket/1.4.3/apache-wicket-1.4.3.zip HTTP/1.1Host: apache.mirror.cdnetworks.comUser-Agent: Mozilla/5.0 Accept: text/html,application/xhtml+xml,application/xmlAccept-Language: ko-kr,ko;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding: gzip,deflateAccept-Charset: EUC-KR,utf-8 Keep-Alive: 300Connection: keep-aliveReferer: http://apache.mirror.cdnetworks.com/wicket/1.4.3/Range: bytes=21341986-If-Match: "d20802f-1d98c87-476447ce3cc00"If-Unmodified-Since: Mon, 19 Oct 2009 07:13:52 GMT
HTTP/1.1 206 Partial ContentDate: Tue, 01 Dec 2009 15:38:24 GMTServer: ApacheLast-Modified: Mon, 19 Oct 2009 07:13:52 GMTETag: "d20802f-1d98c87-476447ce3cc00"Accept-Ranges: bytesContent-Length: 9692517Content-Range: bytes 21341986-31034502/31034503Keep-Alive: timeout=15, max=1000Connection: Keep-AliveContent-Type: application/zip
D/0k…(파일 내용)…
1
2
Resource 일부
8
POST http://192.168.0.100:8080/ HTTP/1.1Host: 192.168.0.100:8080…(중략)…Content-Type: application/x-www-form-urlencodedContent-Length: 39
key1=value1-1&key1=value1-2&key2=value2
<form action="/" method="post"><input name="key1" value="value1-1"/><input name="key1" value="value1-2"/><input name="key2" value="value2"/>
<input type="submit"/></form>
Form
1
9
<form action="/" method="post"><input type="checkbox" name="checked" value="1"/><input name="userdata" value="value1"/><input type="checkbox" name="checked" value="2"/><input name="userdata" value="value2"/><input type="checkbox" name="checked" value="3"/><input name="userdata" value="value3"/><input type="submit"/>
</form>
Form (계속)
POST http://192.168.0.100:8080/ HTTP/1.1Host: 192.168.0.100:8080…(중략)…Content-Type: application/x-www-form-urlencodedContent-Length: 51
check=1&userdata=value1&userdata=value2&check=3&userdata=value3
1
userdata의 개수 = 3개checked의 개수 = 2개!
10
GET http://yahoo.co.kr/ HTTP/1.1Host: yahoo.co.kr…
HTTP/1.1 301 Moved PermanentlyLocation: http://kr.yahoo.comVary: Accept-EncodingContent-Type: text/html; charset=utf-8Age: 533Content-Length: 81
GET http://kr.yahoo.com/ HTTP/1.1Host: kr.yahoo.com…
HTTP/1.1 200 OKContent-Type: text/html…
1
1
2
2
Redirection
11
public class RedirectServlet extends HttpServlet {
@Overrideprotected void service(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
response.setStatus(302);response.setHeader("Location", "http://www.google.com");
}}
Server-side (Java)
response.sendRedirect("http://www.google.com");
12
GET http://www.google.co.kr/… HTTP/1.1Host: www.google.co.kr…(중략)…If-Modified-Since: Tue, 10 Nov 2009 23:51:53 GMTCache-Control: max-age=0
HTTP/1.1 304 Not ModifiedDate: Mon, 30 Nov 2009 16:25:58 GMT…
이후 브라우저가 Caching한 해당 리소스 표시
조건부 GET (캐싱)
1
2
13
벌써 마무리…
칼텍의 동료 교수 핚 사람이 파인만에게 질문을 던졌다.
“스핀이 1/2인 입자들이 페르미디랙의 통계를 따르는 이유가 뭘까?”
파인만은 이렇게 말했다.
“그 내용으로 1학년생들을 위핚 강의를 준비해 보겠네.”
그러나 몇 주가 지난 후에 파인만은 솔직하게 털어 놓았다.
“자네도 짐작했겠지만, 아직 강의 노트를 만들지 못했어. 학부 1학년생들
도 알아듣게 설명핛 방법이 없더라구. 그러니까 내 말은, 우리가 아직 그것
을 제대로 이해하지 못하고 있다는 뜻이야. 내 말 알아듣겠나?”
- 파인만의 물리학 강의 중-
14
URL
http://www.w3.org/Protocolshttp://en.wikipedia.org/wiki/Hypertext_Transfer_Protocolhttp://www.w3.org/2001/tag/webarchhttp://www.ietf.org/rfc/rfc3986 - URIhttp://code.google.com/intl/ko/apis/gdata/docs/2.0/reference.html#ResourceVersioning
서적
Chuck Musciano and Bill Kennedy, HTTP: The Definitive Guide, 2nd Edition, Oreilly, 1998Leonard Richardson and Sam Ruby, RESTful 웹 서비스 : 웹 서비스의 짂화, 정보문화사, 2008리차드 파인만, 파인만의 물리학 강의, 승산, 2004
도구
cURL (http://curl.haxx.se )wireshark (http:// www.wireshark.org)paros (http:// www.parosproxy.org )firebug (https://addons.mozilla.org/ko/firefox/addon/1843)google chrome (http://chrome.google.com)
참고 자료
15