links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
ZnClient (Pharo)
Last updated at 9:28 pm UTC on 2 January 2018
Similar class in Squeak is WebClient.


Basic usage

 ZnClient new get: 'http://zn.stfx.eu/zn/small.html'

> On 7 Dec 2017, at 15:49, Sean P. DeNigris <sean@clipperadams.com> wrote:
> 'https://en.wiktionary.org/wiki/prÍt#French' asUrl ==>
> ZnCharacterEncodingError: ASCII character expected. Ideas?

Non-ASCII characters are not allowed in a URL (in its external string representation, the input of the parser), they must be encoded.

When you construct a URL from parts, the encoding will be done for you, as you specify unencoded elements.

'https://en.wiktionary.org/wiki' asUrl addPathSegment: 'prÍt'; fragment: #French; yourself.

  => https://en.wiktionary.org/wiki/pr%C3%AAt#French

'https://en.wiktionary.org/wiki/pr%C3%AAt#French' asUrl.

And you would be correct to remark that web browsers do allow this, which is more a UI thing.

See also

WebClient/ZnClient wrapper