R – how to get the content of a value posted as the body in asp classic

asp-classichttppostrequestrest

I've seen a couple of rest examples where the xml message gets posted in the body of the http request, and not in a named parameter…

in classic asp I have the request.form object that allows me to get the posted values, but I have to specify the name of the parameter…

is there some way to get the whole content of the post?

I would need the equivalent of

request.serverVariables("QUERY_STRING"), but for the post, not the get part of the http request…

( http://www.w3schools.com/ASP/coll_servervariables.asp )

would I have to use request.binaryRead()???

thanks a lot

ps: in java, I cold achieve this using request.getReader()…
how to get a the value of an http post as a whole? parsing restful post

just to clarify thing a little bit

when I say post a value as the body, I mean that the content of the message is not enconded like param1=value1&param2=value2…paramx=valuex

the message is the body itself… you can achieve this with any ajax library (like prototype) to test ir I'm using a firefox plugin that let you do that, it's named POSTER

https://addons.mozilla.org/en-US/firefox/addon/2691

A developer tool for interacting with web services and other web resources that lets you make HTTP requests, set the entity body, and content type. This allows you to interact with web services and inspect the results…

Best Answer

You didn't specify either what actual content type is being posted nor what you intented to do with it once you've acquired it.

Lets assume for a moment that the content is XML and you want to load it into an XML DOM.

A useful fact about the Request object is that it implements IStream where the stream is the entity body of the POST. Another useful fact is MSXML DOMDocument load method can accept an implementation of IStream. Hence:-

 Dim xml: Set xml = CreateObject("MSXML2.DOCDocument.3.0")
 xml.async = false
 xml.load Request

This code loads the posted entity body into the DOM.