Method supports URL syntax including HTTPS access, port numbers and url based passwords. You can pass username and password information using the second and third parameters for Basic Authentication on the Web server.
The method can POST data to the server by calling AddPostKey() to calling HTTPGet. Any other properties of the wwIPStuff object that affect an HTTP connection (nHTTPPostMode,nHTTPConnectType etc.) can be set prior to calling this method with exception of the following that are retrieved from the URL:
HttpGet calls HttpGetEx() internally so check out that topic as well.
o.HttpGet(lcUrl, lcUsername, lcPassword, lcOutputFile)
lcUserName
Optional - Username used for Basic Authentication
lcPassword
Optional - Password used for Basic Authentication
Note: for backward compatibility the second parameter can also be numeric specifying the size of the result buffer to be returned
lcFileName
An optional path into which to download the content into. If this parameter is used the return value from this method will always return blank and only the file is created on success. To check for errors, check the nError/cErrorMsg and the cResultCode properties.
To send custom headers use cExtraHeader.
We recommend use of this method over HTTPGetEx() since it is much simpler and less prone to invalid parameter passing. HttpGetEx() needs to be used only if you need to stream output directly to a file.
oHTTP=CREATEOBJECT("wwHttp")
lcHTML = oHTTP.HTTPGet("http://www.west-wind.com/")
*** Do something with the HTML
ShowHTML( lcHTML ) && wwUtils.prg
*** With a login and SSL and POSTing data to the server
oHTTP.AddPostkey("Name","Rick Strahl")
oHTTP.Addpostkey("Data","important message")
*** Optionally add custom headers
oHTTP.cExtraHeaders = ;
oHTTP.cExtraHeaders + ;
"cache-control: private" +CRLF +;
"custom-header: custom data" + CRLF
lcHTML = oHTTP.HTTPGet("https://www.west-wind.com/wc.wc?wwDemo~Authenticate",;
"joeuser","biteme")