Forum Post: RE: Rest Client in OE 11.5?

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
This will work , of course, but only on Windows . Note that the design of the HTTP library completely hides the fact that you're using sockets. The API used to make requests is completely technology-agnostic (so one could switch out the socket-based engine with something else). -- peter From: chrisrichardson [mailto:bounce-chrisrichardson@community.progress.com] Sent: Wednesday, 01 April, 2015 04:06 To: TU.OE.Development@community.progress.com Subject: RE: [Technical Users - OE Development] Rest Client in OE 11.5? RE: Rest Client in OE 11.5? Reply by chrisrichardson 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. Stop receiving emails on this subject. Flag this post as spam/abuse.

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