C
Cliff
I've written a simple ASP page which forwards an incoming request to another
server. I'd like to add a variable to the request and have it appear in both
the POST and the GET when forwarding the request. Any ideas how to do this?
Here's the script:
<%@language=JScript%>
<%
var objSrvHTTP=Server.CreateObject("MSXML2.ServerXMLHTTP");
var url=http://anotherserver/
if (Request.ServerVariables("REQUEST_METHOD")=="POST") {
var DataToSend = Request.BinaryRead(Request.TotalBytes);
objSrvHTTP.open("POST",url,false);
objSrvHTTP.setRequestHeader("Content-type","application/x-www-form-urlencode
d");
objSrvHTTP.send(DataToSend);
// need to add another field here
} else {
// need to add another field here
objSrvHTTP.open("GET",url+"?"+Request.ServerVariables("QUERY_STRING"),false)
;
objSrvHTTP.send();
}
Response.Write(objSrvHTTP.responseText);
%>
Thanks!
Cliff.
server. I'd like to add a variable to the request and have it appear in both
the POST and the GET when forwarding the request. Any ideas how to do this?
Here's the script:
<%@language=JScript%>
<%
var objSrvHTTP=Server.CreateObject("MSXML2.ServerXMLHTTP");
var url=http://anotherserver/
if (Request.ServerVariables("REQUEST_METHOD")=="POST") {
var DataToSend = Request.BinaryRead(Request.TotalBytes);
objSrvHTTP.open("POST",url,false);
objSrvHTTP.setRequestHeader("Content-type","application/x-www-form-urlencode
d");
objSrvHTTP.send(DataToSend);
// need to add another field here
} else {
// need to add another field here
objSrvHTTP.open("GET",url+"?"+Request.ServerVariables("QUERY_STRING"),false)
;
objSrvHTTP.send();
}
Response.Write(objSrvHTTP.responseText);
%>
Thanks!
Cliff.