Differences between revisions 1 and 2
Revision 1 as of 2010-09-22 09:11:10
Size: 489
Editor: KaiJaeger
Comment:
Revision 2 as of 2015-04-05 00:01:37
Size: 491
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
CategoryDyalogExamplesDotNet CategoryDotnet CategoryDyalogExamplesDotNet CategoryDotNet

GetViaHttp

Need to get an ordinary HTML page? The following code is doing just that by calling a couple of .NET calls:

s←GetViaHttp url;⎕USING;wrq;wr;str;rdr
⍝ Get a web resource via HTTP
 ⎕USING←'System,System.dll' 'System.Net' 'System.IO' 'System.Text'
 wrq←HttpWebRequest.Create⊂url
 wr←wrq.GetResponse
 str←wr.GetResponseStream
 rdr←⎕NEW StreamReader str
 s←rdr.ReadToEnd
 str.Close


CategoryDyalogExamplesDotNet CategoryDotNet

GetViaHttp (last edited 2015-04-05 01:21:47 by PierreGilbert)