开发者

Cross Domain Post - Losing POST Data

I have 2 servers, both running R2 / IIS7 / ASP Classic sites (can't get around any of that)

Server A is making the follow calls:

Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Msxml2.ServerXmlHTTP.6.0")

xml.Open "POST", templateName, false
xml.setRequestHeader "Content-Type", "application/xml"
xml.Send variables

Where the templateName is the URL of Server B (It's an email template) ... and variables are a name value pair string like a query string password=myPassword&customerEmail=Dear+Bob,....

Server B receives the POST but all the POST data (password=myPassword&customerEmail=Dear+Bob,....) is missing from the POST

password = Request.Form("Password")
customerEmail = Request.Form("CustomerEmail")

The above values are all empty.

Here's the kicker. This all worked on our old servers (Windows Server 20开发者_C百科03, IIS 6)

But when we migrated over, this stopped working correctly.

My question is:

What would cause the POST data to be dropped in IIS 7 when it all worked in IIS 6? I've done about 3 days of research into this trying many different things and nothing has worked.

The POST data is just gone.


The problem is with your Content-Type declaration. It specifies that the post data is XML and not name/value pairs.

xml.setRequestHeader "Content-Type", "application/xml"

You should use this instead...

xml.setRequestHeader "Content-Type", "application x-www-form-urlencoded"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜