J
Jason Burr
I keep getting a server error 400 - Bad Request with the code below.
xmlDoc is the MSXML.DOMDocument populated with the xml data to submit. That
data is well formed and works fine if I urlencode it and send it via a GET
instead of POST. It also prints out nice if I simply send it out so I know
thats not the issue. No matter what I put in there or if I add the data from
the document into a querystring nothing works. I am assuming that it is my
web server that doesn't like something but can't for the life of me figure
out what.
What I have tried to change
1. alter the url to include querystring data and simply call send with no
content
2. removing the ? from the url
3. adding the xml content header to the string being sent
4. changing the setRequestHeader to "application/x-www-form-urlencoded"
5. submiting nothing to see if the remote server will at least return an
error
6. using xmlDoc.xml to place content in send
I am ready to pull my hair out here I have not had a single "POST" work only
the "GET" method. (actually that seems now to have discontinued working)
strURL = "http://testing.shippingapis.com/ShippingAPItest.dll?"
Set xmlServer = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlServer.Open "POST", strURL, False
xmlServer.setRequestHeader "content-type", "text/xml"
xmlServer.Send(xmlDoc)
xmlDoc is the MSXML.DOMDocument populated with the xml data to submit. That
data is well formed and works fine if I urlencode it and send it via a GET
instead of POST. It also prints out nice if I simply send it out so I know
thats not the issue. No matter what I put in there or if I add the data from
the document into a querystring nothing works. I am assuming that it is my
web server that doesn't like something but can't for the life of me figure
out what.
What I have tried to change
1. alter the url to include querystring data and simply call send with no
content
2. removing the ? from the url
3. adding the xml content header to the string being sent
4. changing the setRequestHeader to "application/x-www-form-urlencoded"
5. submiting nothing to see if the remote server will at least return an
error
6. using xmlDoc.xml to place content in send
I am ready to pull my hair out here I have not had a single "POST" work only
the "GET" method. (actually that seems now to have discontinued working)
strURL = "http://testing.shippingapis.com/ShippingAPItest.dll?"
Set xmlServer = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlServer.Open "POST", strURL, False
xmlServer.setRequestHeader "content-type", "text/xml"
xmlServer.Send(xmlDoc)