Making XMLRequest Through Proxy Server

using proxy settings  in Ajax

but this only works for me when object is of type winhttp

dim objWinHttp
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5")
objWinHttp.Open "POST", strURL
objWinHttp.SetProxy 2, "proxy1:8080"
objWinHttp.SetCredentials "gooddomain\userid", "goodpassword", 1
objWinHttp.SetRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
objWinHttp.SetTimeouts 30000, 30000, 30000, 30000
objWinHttp.Send m_cPostBuffer
if Err.number <> 0 then strHTML = "There is a problem in reaching the Remote host. Please try again later, or contact the Content Manager if the problem persists. Error: " & Err.number & " " & Err.description & strURL & " " strHTML = strHTML & "Status: " & objWinHttp.Status & " " & objWinHttp.StatusText ‘ Get the text of the response. else strHTML = objWinHttp.ResponseText
end if Set objWinHttp = Nothing ‘return the html to the calling program GlobalScreenScrapex = strHtml end Function

Orignal Article

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: