Squeak
  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 1:09 am UTC on 8 December 2017
Similar class in Squeak is WebClient.

https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-HTTP-Client/Zinc-HTTP-Client.html



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.