[squeak-dev] The Inbox: HelpSystem-Core-kks.120.mcz

K K Subbu kksubbu.ml at gmail.com
Fri Apr 3 15:03:32 UTC 2020


On 03/04/20 1:24 PM, Levente Uzonyi wrote:
> I think the proper way to do this would be to leave HTTPSocket behind 
> and rely on the response code instead of checking for a specific 
> substring in the response body.

httpGet does not return a HTTP response object but a string in case of 
errors. This is why I put in this check.

Did you mean I could have done something like this:

^ document ifNil: [
     |resp|
     resp := HTTPSocket httpGetDocument: self url accept:'text/html'.
     document := resp isString ifTrue: [nil] ifFalse: [resp contents]]

This would mean retries even for 4xx or 3xx codes :-(

Regards .. Subbu




More information about the Squeak-dev mailing list