Submitting XMLHTTP request - POST size limit

I have a VB app that submits XMLHTTP requests.  Previously, I would use the following code:

  sURL = ""
  oXMLReq.Open "POST", sURL, True

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, (not necessary to read), which provided a work-around for my problem.  Here's my new code:

  sURL = ""
  sExpression = "Username=George&Password=12345"
  oXMLReq.Open "POST", sURL, True
  oXMLReq.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
  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!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

> Am I going about this the wrong way?

At first you were.  You were using a query string with a POST operation, when you should have been using a Get operation.  Presumably whatever was on the server in the "validate.asp" script didn't care.  However, now you are using post correctly , and it is not returning anything...  It is likely that the validate.asp script is reading the query string and not the form... In other words, validate asp has to make some changes.  Where it says:


It should say instead:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
By the way, there is no size limit to POST.  There is however a limit to GET and the query string.  The query string is the parameterized string that follows the URL of the script you are calling.  POST embeds the data in the HTTP request itself, so it is not limited in the same way.

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...
afterthoughtAuthor Commented:
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!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.