SstHttpClient fetch: url

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SstHttpClient fetch: url

Louis LaBrunda
Hi Everyone,

I use "SstHttpClient fetch: url" to download files both small and large.  For example:

SstHttpClient fetch: 'http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt'.


It works great!  However it doesn't work with a URL like this: "file:///c:\test.txt".

I don't know that it should and it may be out of place to make SstHttpClient work with that kind of URL but I think it would be cool if it did.

I know that everyone at Instantiations is working hard adding really great improvements to the product and I don't think this falls into that category but if 99.5% of the code was already there and it wouldn't take much effort to add the feature, it would round out the function.  What does everyone else think?

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SstHttpClient fetch: url

Richard Sargent
Administrator
On Wednesday, September 7, 2016 at 7:11:11 AM UTC-7, Louis LaBrunda wrote:
Hi Everyone,

I use "SstHttpClient fetch: url" to download files both small and large.  For example:

SstHttpClient fetch: '<a href="http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.keystone-software.com%2Fftp%2Fdownload%2Fwindows%2FX10%2FVersion.Txt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvjeYgtA0HIJR2SnVkTRLjyON8MQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.keystone-software.com%2Fftp%2Fdownload%2Fwindows%2FX10%2FVersion.Txt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvjeYgtA0HIJR2SnVkTRLjyON8MQ&#39;;return true;">http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt'.


It works great!  However it doesn't work with a URL like this: "file:///c:\test.txt".

I don't know that it should and it may be out of place to make SstHttpClient work with that kind of URL but I think it would be cool if it did.

As much as I think your feature request is great, I think the proposal is wrong. :-)
An HTTP client should work with HTTP protocols. Period.

A suitable subclass or a sibling class (or classes) should be introduced for any other protocols.
 

I know that everyone at Instantiations is working hard adding really great improvements to the product and I don't think this falls into that category but if 99.5% of the code was already there and it wouldn't take much effort to add the feature, it would round out the function.  What does everyone else think?

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SstHttpClient fetch: url

Louis LaBrunda
Hi Richard,

On Wednesday, September 7, 2016 at 1:00:14 PM UTC-4, Richard Sargent wrote:
On Wednesday, September 7, 2016 at 7:11:11 AM UTC-7, Louis LaBrunda wrote:
Hi Everyone,

I use "SstHttpClient fetch: url" to download files both small and large.  For example:

SstHttpClient fetch: '<a href="http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.keystone-software.com%2Fftp%2Fdownload%2Fwindows%2FX10%2FVersion.Txt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvjeYgtA0HIJR2SnVkTRLjyON8MQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.keystone-software.com%2Fftp%2Fdownload%2Fwindows%2FX10%2FVersion.Txt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvjeYgtA0HIJR2SnVkTRLjyON8MQ&#39;;return true;">http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt'.


It works great!  However it doesn't work with a URL like this: "file:///c:\test.txt".

I don't know that it should and it may be out of place to make SstHttpClient work with that kind of URL but I think it would be cool if it did.

As much as I think your feature request is great, I think the proposal is wrong. :-)
An HTTP client should work with HTTP protocols. Period.

A suitable subclass or a sibling class (or classes) should be introduced for any other protocols.

I wouldn't argue with that.  It was just the simplest way to describe the functionality.  I could see some other class that implemented #fetch: and then called SstHttpClient or whatever based on the beginning of the URL.

Since URL means Uniform Resource Locator it might be nice to have a class that could fetch the data for any valid URL.

Lou
 

I know that everyone at Instantiations is working hard adding really great improvements to the product and I don't think this falls into that category but if 99.5% of the code was already there and it wouldn't take much effort to add the feature, it would round out the function.  What does everyone else think?

Lou


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SstHttpClient fetch: url

Richard Sargent
Administrator
On Wednesday, September 7, 2016 at 10:39:10 AM UTC-7, Louis LaBrunda wrote:
Hi Richard,

On Wednesday, September 7, 2016 at 1:00:14 PM UTC-4, Richard Sargent wrote:
On Wednesday, September 7, 2016 at 7:11:11 AM UTC-7, Louis LaBrunda wrote:
Hi Everyone,

I use "SstHttpClient fetch: url" to download files both small and large.  For example:

SstHttpClient fetch: '<a href="http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.keystone-software.com%2Fftp%2Fdownload%2Fwindows%2FX10%2FVersion.Txt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvjeYgtA0HIJR2SnVkTRLjyON8MQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.keystone-software.com%2Fftp%2Fdownload%2Fwindows%2FX10%2FVersion.Txt\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvjeYgtA0HIJR2SnVkTRLjyON8MQ&#39;;return true;">http://www.keystone-software.com/ftp/download/windows/X10/Version.Txt'.


It works great!  However it doesn't work with a URL like this: "file:///c:\test.txt".

I don't know that it should and it may be out of place to make SstHttpClient work with that kind of URL but I think it would be cool if it did.

As much as I think your feature request is great, I think the proposal is wrong. :-)
An HTTP client should work with HTTP protocols. Period.

A suitable subclass or a sibling class (or classes) should be introduced for any other protocols.

I wouldn't argue with that.  It was just the simplest way to describe the functionality.  I could see some other class that implemented #fetch: and then called SstHttpClient or whatever based on the beginning of the URL.

Since URL means Uniform Resource Locator it might be nice to have a class that could fetch the data for any valid URL.

I would say that the usual best practice would be a registry of support schemes, identifying the implementing client class to use. An alternative is to have the hierarchy answer the schemes each class supports. But that's weaker, since one cannot bring in a new class as a custom or enriched handler for a given scheme. It also imposes a hierarchy which need not be required.
 

Lou
 

I know that everyone at Instantiations is working hard adding really great improvements to the product and I don't think this falls into that category but if 99.5% of the code was already there and it wouldn't take much effort to add the feature, it would round out the function.  What does everyone else think?

Lou


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.