Next the afore mentioned mail:
This is a list of the most important changes to Zn since May 1st 2011:
- added brand new ZnClient to replace all other HTTP clients (who became deprecated)
this is an object to build, execute and process HTTP client requests,
it has a rich protocol to construct requests and to access responses,
it has various error handling options,
it can reuse an existing connection to a specific host:port,
it can handle sessions, cookies, redirects and authentication,
it has many options (settings) with sensible defaults.
here is the simplest example:
and here is an example using some features to make a better HTTP request:
accept: ZnMimeType textPlain;
contentReader: [ :entity | entity contents lines collect: [ :each | each asNumber ] ];
ifFail: [ :exception | self inform: 'I am sorry: ', exception printString ];
- added support so that HTTPS works out of the box if Zodiac is present.
this should work when Zodiac is loaded and the necessary plugin is present:
queryAt: 'q' put: 'Pharo Smalltalk';
- added a new subclass, ZnManagingMultiThreadedServer, that keeps track of open
worker connections so that they can be properly closed when needed.
to use this server with the Zn Seaside adaptor, you can do this:
- refactored ZnNetworkingUtils, it is now (also) a factory for creating socket streams
- added ZnDispatcherDelegate for straight-forward dispatching to mapped urls (thx Nick Ager)
- cleanup of the cookie handling API
- fixed support for HTTP proxies (thx Alexandre Bergel for reporting)
- localhost URLs are now excluded from being proxied
- working around SocketStream>>#atEnd issues by using #peek
- implemented support for proxies that require authorization
- introduced ZnConnectionTimeout process variable
- added ManagedServers class variable to ZnServer to dispatch the system's
#startUp/#shutDown messages to all server instances that are #register-ed
- implemented client side support for If-Modified-Since and Not Modified
- changed ZnMimePart>>#fieldValueString to return an empty string instead of 'nil'
when the field is empty or absent (Thx Lukas Renggli)
- added support for dealing with certain defaults in ZnUrl
- added code to throw a ZnMissingHost exception when a bogus ZnUrl is used to connect to a HTTP host
- added ZnMimeType wildcard constants #any and #text
- added ZnHttpUnsuccessful and ZnUnexpectedContentType exceptions
- added a nice example to ZnEasy class>>#getPng: (Thx Lukas Renggli)
- added ZnUtils class>>#parseHttpDate: for use in ZnCookie>>#expiresTimeStamp
- added optional delegate #close-ing to ZnServer hierarchy
- added some Pharo 1.2 compatibility (ZnMultiThreadedServer>>#
- lots of small fixes, cleanup and improved documentation.
And don't miss the Getting Started guide!