Discussion:
WinHttp.WinHttpRequest.5.1 - setRequestHeader
(too old to reply)
Luiz Carlos Leonesse
2018-05-13 15:06:12 UTC
Permalink
Hi, everyone. I´m new at vbscript and need some help. I have a function using WinHttp.WinHttpRequest.5.1. I need to see what i´m sending with my headers. For example:
call gXMLHTTP.setRequestHeader("Connection","keep-alive")
I need to see if "Connection" value is really "keep-alive".
How can i do this?
I try with MsgBox Connection, but don´t work.
R.Wieser
2018-05-13 17:48:42 UTC
Permalink
Luiz,
Post by Luiz Carlos Leonesse
I need to see if "Connection" value is really "keep-alive".
How can i do this?
That XMLHTTP object does not seem to expose a "getRequestHeader", so you
can't ask for a preview.

That leaves sending the request to a (small, perhaps local) webserver you
control, or to a server which will kindly return your request headers as a
HTML page. :-)

Like this one:

http://scooterlabs.com/echo

... which google came back with when I threw a quick "HTTP echo" at it. :-)

Regards,
Rudy Wieser
Evertjan.
2018-05-13 20:24:01 UTC
Permalink
Post by R.Wieser
Luiz,
Post by Luiz Carlos Leonesse
I need to see if "Connection" value is really "keep-alive".
How can i do this?
That XMLHTTP object does not seem to expose a "getRequestHeader", so you
can't ask for a preview.
That leaves sending the request to a (small, perhaps local) webserver you
control, or to a server which will kindly return your request headers as a
HTML page. :-)
http://scooterlabs.com/echo
... which google came back with when I threw a quick "HTTP echo" at it. :-)
Just make your own testKeepAlive.asp page containing only:

<% = Request.ServerVariables("HTTP_CONNECTION") %>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Continue reading on narkive:
Loading...