views:

277

answers:

2

Set oXMLHttp=Server.CreateObject("MSXML2.XMLHTTP")

On Error Resume Next
    oXMLHttp.open "GET", "http://xxxxxx.com",False
    oXMLHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    oXMLHttp.send()
    x        = oXMLHttp.responseText

I'm getting this error: Access Denied

A: 

Browsers have a same domain policy. This means you cannot do xhr calls to other domains. You will either have to use a server side proxy service on your domain to do the remote call for you or if the endpoint supports jsonp you can use a script tag to emulate an xhr call.

redsquare
A: 

Where r u getting the error? On the server postback or on the web page? My guess is that this should not happen if you are doing this via server side. However if you are doing this via javascript within your html page then the same-origin policy might cause a problem

deostroll
I'm doing this on the server side in asp.