Zn Tuesday 22 May 12
Zn Pharo Conference May 2012 Sven Van Caekenberghe Tuesday 22 May 12
Zinc HTTP Components Tuesday 22 May 12
started Sept 2010 included in Pharo 1.3, 1.4, 2.0 Tuesday 22 May 12
WWW HTTP Tuesday 22 May 12
[ | ] Understandability Tuesday 22 May 12
HTTP Framework Tuesday 22 May 12
Client / Server Tuesday 22 May 12
Request Client Server Response Tuesday 22 May 12
Model Tuesday 22 May 12
ZnRequest ZnClient ZnServer ZnResponse Tuesday 22 May 12
ZnRequest Tuesday 22 May 12
ZnRequest ZnRequestLine ZnHeaders ZnMessage ZnEntity Tuesday 22 May 12
ZnRequest ZnRequestLine ZnHeaders ZnMessage Tuesday 22 May 12
ZnRequest ZnRequestLine Verb URI ZnHeaders ZnMessage key:value * ZnEntity type/length/content Tuesday 22 May 12
ZnResponse Tuesday 22 May 12
ZnRespone ZnStatusLine ZnHeaders ZnMessage ZnEntity Tuesday 22 May 12
ZnResponse ZnStatusLine ZnHeaders ZnMessage Tuesday 22 May 12
ZnResponse ZnStatusLine Code Reason ZnHeaders ZnMessage key:value * ZnEntity type/length/content Tuesday 22 May 12
example Tuesday 22 May 12
ZnClient new get: ‘http://zn.stfx.eu/zn/small.html’. Tuesday 22 May 12
ZnRequest GET /zn/small.html HTTP/1.1 Host: zn.stfx.eu ZnMessage User-Agent: Zinc... Tuesday 22 May 12
ZnResponse HTTP/1.1 200 OK Date: Tue, 08 May.. ZnMessage Server: Zinc... text/html, 113B <html>...</html> Tuesday 22 May 12
Framework Tuesday 22 May 12
Core Tuesday 22 May 12
Zinc-HTTP-Core • ZnMessage • ZnRequest • ZnResponse • ZnHeaders • ZnRequestLine • ZnStatusLine Tuesday 22 May 12
Zinc-HTTP-Core • ZnEntity • ZnStringEntity • ZnByteArrayEntity • ZnStreamingEntity Tuesday 22 May 12
Zinc-HTTP-Core • ZnEntity • ZnMultiPartFormDataEntity • ZnApplicationFormUrlEncodedEntity • ZnMimePart Tuesday 22 May 12
Support Tuesday 22 May 12
Zinc-HTTP-Support • ZnUrl • ZnMimeType Tuesday 22 May 12
Zinc-HTTP-Support • Networking • Authentication & Authorization • Sessions, Cookies • Constants, Parameters, Settings • Utils Tuesday 22 May 12
Streaming Tuesday 22 May 12
Zinc-HTTP-Streaming • Binary IO • Bivalent Output • Character Encoding/Decoding • Chunked, Gzip Transfer Tuesday 22 May 12
Exceptions Tuesday 22 May 12
Zinc-HTTP-Exceptions • Protocol specific • Implementation Limits • Parsing Errors Tuesday 22 May 12
Logging Tuesday 22 May 12
Zinc-HTTP-Logging • Announcement based • Destinations • Transcript • File • Stdout • Memory Tuesday 22 May 12
Client Tuesday 22 May 12
Zinc-HTTP-Client-Server • ZnClient • build requests • execute requests • process responses • manage state Tuesday 22 May 12
Correct HTTP Client Use • ZnClient offers • URI construction • error handling • retry management • response handling • accept/content-type matching Tuesday 22 May 12
MCHttpRepository>>allFileNames | index | self displayProgress: 'Updating ', self description during: [ index := ZnClient new systemPolicy; beOneShot; signalProgress: true; accept: ZnMimeType text; ifFail: [ :exception | self error: 'Could not access ', location, ': ', exception printString ]; url: self locationWithTrailingSlash; queryAt: 'C' put: 'M;O=D'; username: self user password: self password; get ]. ^ self parseFileNamesFromStream: index readStream Tuesday 22 May 12
Smalltalk HTTP Scripting • ZnClient does • streaming downloads & uploads • follows redirects • write/read content representations • proxies, cookies, sessions • authentication, login, ... Tuesday 22 May 12
Server Tuesday 22 May 12
Zinc-HTTP-Client-Server • ZnServer • run protocol • infrastructure • delegate #handleRequest: • delegate #authenticateRequest:do: Tuesday 22 May 12
Zinc-HTTP-Client-Server • ZnServer • ZnDefaultServerDelegate • ZnStaticFileServerDelegate • ZnMonticelloServerDelegate Tuesday 22 May 12
Seaside Tuesday 22 May 12
ZnZincServerAdaptor default in/for Pharo complete Seaside3 functionality efficient binary data transfer Tuesday 22 May 12
Documentation Tuesday 22 May 12
Zn Paper / PBE2 Chapter Class / Method Comments 220+ Unit & Functional Tests QA = CI + IDE + Production Tuesday 22 May 12
http://zn.stfx.eu Zinc HTTP Components Tuesday 22 May 12
Zn May the source be with you Tuesday 22 May 12
Zn Tuesday 22 May 12
Recommend
More recommend