views:

2184

answers:

2

In my previous question, I was accidentally sending token/value pairs with an text/xml content-type which resulted in nothing being sent. Tim C's insight into that problem was extremely helpful. Thanks again, Tim!

Looking back at the original sending code, I now realize that the setting of the ServerXMLHTTP's content-type to text/xml was a recent and erroneous addition. The sending code I posted in my question looked like this...

url = "www.receivingwebsite.com\asp\receivingwebpage.asp"
information = "UserName=Colt&PassWord=Taylor&Data=100"
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send information

The actual sending code is really....

url = "www.receivingwebsite.com\asp\receivingwebpage.asp"
information = "UserName=Colt&PassWord=Taylor&Data=100"
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.send information

...with no attempt to set the content-type before sending.

Unfortunately, the problem that originally lead me to ask for help still exists. My receiving classic asp page cannot see the information which is being posted by the ServerXMLHTTP object. The information is not in the request object's querystring or the form array. No matter what I do, I can't find the information but I know that it is being sent because when I change the content-type to "application/x-www-form-urlencoded", I can see it in request.form array.

So what is the default content-type of the MSXML2.ServerXMLHTTP class? And where is my information when the sending class is using that default content-type?

Thanks in advance for any assistance! Peace, Colt Taylor

A: 

ASP will only fill the form array if the content type of the POST is "application/x-www-form-urlencoded". Generally ServerXMLHTTP will not set the content type header so if you don't do it manually no content type header is sent.

An exception to this is where you pass an XML Document as the parameter to send, in that case ServerXMLHTTP will set content type to "test/xml; charset=UTF-8".

AnthonyWJones
A: 

Thanks Anthony! What you described is exactly what I am experiencing. It is good to know that I'm not loosing it.

Fortunately, my manager has ok'ed my moving the receiving project up to ASP.NET allowing me to use the Request.Inputstream which can see the fields even though they are not properly loaded in the form array.

Thanks again! Peace, Colt