[Pharo-project] Towards better HTTP client usage

Philippe Marschall kustos at gmx.net
Mon Sep 5 15:14:13 EDT 2011

On 04.09.2011 20:22, Sven Van Caekenberghe wrote:
> Towards better HTTP client usage
> At the last Pharo Sprint in Lille (July 8th), Stéphane and I were at one point trying to remove some old HTTPSocket usage (which indirectly uses Zn) and replace it with direct and clean Zn usage. We hadn't much time left and didn't get very far. But I realized afterwards that although technically everything was there to write good HTTP client code, it was way too difficult (it required to much code on the user's behalf).
> Hence I decided to try write a new client that would support this usage much better and encourage better HTTP client usage in general. Another goal of this new client is to ultimately replace all other clients currently in Zn (these different client are creating some confusion among users).
> ZnNeoClient (a temporary name, to be renamed to ZnClient in the future) is a single object with a lot of (convenience) API to build, execute and process HTTP client requests. It is somewhat similar to Gofer like classes. It is also somewhat comparable to ZnHttpClient but it contains even more functionality. 
> The new tests in ZnNeoClientTests show some of the ways the client can be used. In the current Zn version all ZnClient class functionality as well as all ZnHTTPSocketFacade (and thus HTTPSocket and thus the rest of the image) has already been reimplemented using ZnNeoClient. These are good examples to look at.
> At one point I plan to write some proper documentation, when the design settles down a bit, but here are some examples:
> The simplest possible usage:
> ZnNeoClient new get: 'http://zn.stxfx.eu/zn/small.html'.

So… is that URL already percent encoded? If it isn't how do I specify
what encoding should be used? ;-)


More information about the Pharo-dev mailing list