[progress Communities] [progress Openedge Abl] Forum Post: Http Requests Via Authenticated...

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

chrisrichardson

Guest
A while back I posted this thread https://community.progress.com/community_groups/openedge_development/f/19/t/23788 At the time we decided to workaround the proxy issue with our own 4GL socket implementation and some external .net tools. I've just installed 11.7.1, and am playing around with the http client again. Is it possible to pass in username & password to the proxy server? The request below is definitely hitting the proxy server as I'm getting a 302 (Auth Required back). Tried both options below - is there another way to build the proxy client? And is authenticated proxy server supported? Any top tips with this? USING OpenEdge.Net.URI. USING OpenEdge.Net.HTTP.IHttpRequest. USING OpenEdge.Net.HTTP.IHttpResponse. USING OpenEdge.Net.HTTP.IHttpClient. USING OpenEdge.Net.HTTP.RequestBuilder. USING OpenEdge.Net.HTTP.ClientBuilder. DEFINE VARIABLE oRequest AS IhttpRequest NO-UNDO. DEFINE VARIABLE oResponse AS IhttpResponse NO-UNDO. DEFINE VARIABLE httpUrl AS CHARACTER NO-UNDO. def var oClient as IHttpClient no-undo. httpUrl = " http://www.theregister.co.uk" . oRequest = RequestBuilder:Get(httpUrl):Request. oClient = new OpenEdge.Net.HTTP.ProxyHttpClient( ClientBuilder:Build():Client, URI:Parse(' username:password@proxyip:proxyport')) . oResponse = oClient:Execute(oRequest). /* *** OR */ oRequest = RequestBuilder:Get(httpUrl):ViaProxy(' username:password@proxyip:proxyport'):Request . oResponse = ClientBuilder:Build():Client:Execute(oRequest). MESSAGE oResponse:StatusCode oResponse:StatusReason view-as alert-box info. Thanks

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