afterthought
asked on
Submitting XMLHTTP request - POST size limit
I have a VB app that submits XMLHTTP requests. Previously, I would use the following code:
Set oXMLReq = New MSXML2.XMLHTTP
sURL = "https://www.oursite.com/asp/Validate.asp?Username=George&Password=12345"
oXMLReq.Open "POST", sURL, True
oXMLReq.send
The response would be loaded into a DOM document then opened into a recordset. This approach works fine... until our requests (sURL) exceed 2000+ characters, at which point we receive the following error: "The system cannot locate the resource specified"
I found this link, http://www.up.org.nz/community/viewthread.php?tid=612 (not necessary to read), which provided a work-around for my problem. Here's my new code:
Set oXMLReq = New MSXML2.XMLHTTP
sURL = "https://www.oursite.com/asp/Validate.asp"
sExpression = "Username=George&Password= 12345"
oXMLReq.Open "POST", sURL, True
oXMLReq.setRequestHeader "Content-type", "application/x-www-form-ur lencoded"
oXMLReq.send sExpression
This code however returns responseText = "" as its response; I would have assumed that because it's essential the same operation as the first code sample above, that the results would be the same too. Aren't these 2 code samples doing the same thing?? Therefore the results should be the same... no?
I think I'm missing something fundamental here. Am I going about this the wrong way? Any insight would be greatly appreciated!!
Set oXMLReq = New MSXML2.XMLHTTP
sURL = "https://www.oursite.com/asp/Validate.asp?Username=George&Password=12345"
oXMLReq.Open "POST", sURL, True
oXMLReq.send
The response would be loaded into a DOM document then opened into a recordset. This approach works fine... until our requests (sURL) exceed 2000+ characters, at which point we receive the following error: "The system cannot locate the resource specified"
I found this link, http://www.up.org.nz/community/viewthread.php?tid=612 (not necessary to read), which provided a work-around for my problem. Here's my new code:
Set oXMLReq = New MSXML2.XMLHTTP
sURL = "https://www.oursite.com/asp/Validate.asp"
sExpression = "Username=George&Password=
oXMLReq.Open "POST", sURL, True
oXMLReq.setRequestHeader "Content-type", "application/x-www-form-ur
oXMLReq.send sExpression
This code however returns responseText = "" as its response; I would have assumed that because it's essential the same operation as the first code sample above, that the results would be the same too. Aren't these 2 code samples doing the same thing?? Therefore the results should be the same... no?
I think I'm missing something fundamental here. Am I going about this the wrong way? Any insight would be greatly appreciated!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Paul,
Thanks so much for your helpful insight! You correctly guessed that Validate.asp was indeed using Requst.QueryString. I've corrected it and everything is now working great! The size limitation is gone now as well. Thank you!!!
Thanks so much for your helpful insight! You correctly guessed that Validate.asp was indeed using Requst.QueryString. I've corrected it and everything is now working great! The size limitation is gone now as well. Thank you!!!
On the server side ASP script, the request.querystring is used to read the query string of a GET operation. request.form is used to read the data sent by POST...