Forum Post: RE: Rest Client in OE 11.5?

  • Thread starter Thread starter chrisrichardson
  • Start date Start date
Status
Not open for further replies.
C

chrisrichardson

Guest
Thanks Peter, will check this out. In the mean time I put this together based on some examples on here and elsewhere. This has got me going for now (I didn't want to go down to socket route!) using System.*. def var HttpClient as class System.Net.WebClient. def var webResponse as longchar no-undo. fix-codepage (webResponse) = "UTF-8". def var appKey as char no-undo initial "MyAppKey". HttpClient = new System.Net.WebClient(). HttpClient:Proxy:Credentials = System.Net.CredentialCache:DefaultNetworkCredentials. HttpClient:Headers:Add("key",'"' + appKey + '"' ). webResponse = HttpClient:DownloadString("http://api.worldbank.org/countries?format=json"). HttpClient:Dispose(). delete object HttpClient. message string(webResponse) view-as alert-box.

Continue reading...
 
Status
Not open for further replies.
Back
Top