Sending an HTTP Request 
Author Message
 Sending an HTTP Request

Is it possible to use VBScript to send an HTTP request over ssl and record
the responce into a variable that I can then parse?


Sat, 06 Sep 2003 04:39:23 GMT  
 Sending an HTTP Request
set http = createobject("msxml2.xmlhttp")
url = "https://blahblah/blahblah/blahblah.asp"
http.open "get",url,false
http.send
text = http.responsetext

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> Is it possible to use VBScript to send an HTTP request over ssl and record
> the responce into a variable that I can then parse?



Sat, 06 Sep 2003 06:09:46 GMT  
 Sending an HTTP Request
This looks promising, but what about doing a post operation?
Quote:

> set http = createobject("msxml2.xmlhttp")
> url = "https://blahblah/blahblah/blahblah.asp"
> http.open "get",url,false
> http.send
> text = http.responsetext

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --


> > Is it possible to use VBScript to send an HTTP request over ssl and record
> > the responce into a variable that I can then parse?



Sat, 06 Sep 2003 06:26:36 GMT  
 Sending an HTTP Request
Here's a post from Vasile Montan that I saved.  It's JScript but covert to VBScript is pretty
trivial...

Note: sRequest is passed in already in urlencoded querystring format.

e.g., vname1=value1&vname2=value2&vname3=value3&...&vnameN=valueN

where each value has been escaped.

<post from Vasile Montan>

I solved my own problem, so just in case anyone else has this same problem.
You need to set the Content-Type to application/x-www-form-urlencoded not
the encoding. Here is the full working example:

function testPost(sRequest)
{
var oHTTP = new ActiveXObject("Microsoft.XMLHTTP");
try {
oHTTP.open("POST", "vars.asp", false);
oHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
oHTTP.setRequestHeader("Content-Length", sRequest.length);
oHTTP.send(sRequest);

alert("Status = " + oHTTP.status + "\r\n" + oHTTP.responseText);
return oHTTP.responseXML;

Quote:
} catch (e) {
alert("exception");
}
return null;
}

</post from Vasile Montan>

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> This looks promising, but what about doing a post operation?


> > set http = createobject("msxml2.xmlhttp")
> > url = "https://blahblah/blahblah/blahblah.asp"
> > http.open "get",url,false
> > http.send
> > text = http.responsetext

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --


> > > Is it possible to use VBScript to send an HTTP request over ssl and record
> > > the responce into a variable that I can then parse?



Sat, 06 Sep 2003 10:01:48 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Send a http request directly to an access database.

2. Sending a http request to a gci-bin access database.

3. how to send a cookie with HTTP request?

4. Question for send request http in my website

5. Sending username and password in http request?

6. ICP HTTP - send request to cgi-script - HOW ???

7. Sending http Request to a Servlet

8. sending http request through dll running on the server

9. sending http request through dll running on the server

10. Sending HTTP request

11. http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu http://www.besamung.de.vu

12. Making an HTTP request from an ASP

 

 
Powered by phpBB® Forum Software