Using JavaScript in HomeSite 4.0, Part III: The HTTPProvider Object's Methods, Part I
Using JavaScript in HomeSite 4.0, Part III
The HTTPProvider Object's Methods, Part I
The HTTPProvider
object supports a handful of methods:
Get() | None |
Performs the HTTP GET method request. You have to set all appropriate HTTPProvider
object's properties to set the HTTP request parameters such as username, password, proxy server and settings, etc. The following script issues the Get() method and then prints the HTTPProvider
object's properties:
var app = Application;
function Main() {
app.HTTPProvider.URL = "https://www.webreference.com/js";
app.HTTPProvider.Get();
app.MessageBox(
"Agent='" + app.HTTPProvider.Agent + "'\n" +
"AuthorizationRequest='" + app.HTTPProvider.AuthorizationRequest + "'\n"+
"ContentLength='" + app.HTTPProvider.ContentLength + "'\n" +
"ContentType='" + app.HTTPProvider.ContentType + "'\n" +
"ContentTypePost='" + app.HTTPProvider.ContentTypePost + "'\n" +
"Cookie='" + app.HTTPProvider.Cookie + "'\n" +
"DocName='" + app.HTTPProvider.DocName + "'\n" +
"Location='" + app.HTTPProvider.Location + "'\n" +
"ModifiedSince='" + app.HTTPProvider.ModifiedSince + "'\n" +
"MultiThreaded='" + app.HTTPProvider.MultiThreaded + "'\n" +
"NoCache='" + app.HTTPProvider.NoCache + "'\n" +
"Password='" + app.HTTPProvider.Password + "'\n" +
"Proxy='" + app.HTTPProvider.Proxy + "'\n" +
"ProxyPassword='" + app.HTTPProvider.ProxyPassword + "'\n" +
"ProxyPort='" + app.HTTPProvider.Proxyport + "'\n" +
"ProxyUsername='" + app.HTTPProvider.ProxyUsername + "'\n" +
"RcvdCount='" + app.HTTPProvider.RcvdCount + "'\n" +
"ReasonPhrase='" + app.HTTPProvider.ReasonPhrase + "'\n" +
"Reference='" + app.HTTPProvider.Reference + "'\n" +
"Sender='" + app.HTTPProvider.Sender + "'\n" +
"SentCount='" + app.HTTPProvider.SentCount + "'\n" +
"State='" + app.HTTPProvider.State + "'\n" +
"StatusCode='" + app.HTTPProvider.StatusCode + "'\n" +
"URL='" + app.HTTPProvider.URL + "'\n" +
"Username='" + app.HTTPProvider.Username + "'\n",
"HTTP Provider Diagnostics", 0);
app = null;
}
Here is how this MessageBox
looks:
Produced by Yehuda Shiran and Tomer Shiran
Created: October 11, 1999
Revised: October 15, 1999
URL: https://www.webreference.com/js/column50/httpmeth1.html