Even though ASP sucks I have had an occasion or two to use it. and I did 
use this functionality.

The code is an ASP (vbscript) function that relies on the MS COM Object.

here is the code:


function httpCall (url, method, ContentType, sRequest)
'function httpCall.
'Makes an HTTP Request to webserver. This request can be local or external, 
it can use SSL but does not have to
'URL: a complete web address. This must include the protocol prefix 
(http:// or https://)
'method: the request method, typically "GET" or "POST", other acceptable 
values are "PUT" and "DELETE", most application cannot support these two 
methods
'ContentType: the mime type that is being sent.
'       text/plain: used for normal GET operations
'       application/x-www-form-urlencoded: used when sending form data with 
a POST
'       application/xml: used when sending preformated XML in the request
'       Other Mime types are allowed these three are the most commonly 
used. Consult with the technical department of the website you are 
accessing to determine the mime type that is used
'sRequest: Data that is being sent. Please note that no conversion is being 
done. If you are posting Form Data you must URLEncode each value before 
sending it.
         dim http 'Contains the object

         'Open the Object
         set http = createobject("msxml2.xmlhttp")

         'open the call and set the URL,  method, and Content-Type
         http.open method,url,false
         http.setRequestHeader "Content-Type", ContentType

         'Determine the Content Length of the data being Posted.
         http.setRequestHeader "Content-Length", len(sRequest)

         'Send the request with any data being Posted
         http.send sRequest

         'Return the output
         httpCall = http.responsetext

         'http.close
         set http = Nothing
end function

At 04:23 PM 5/16/2001 +0100, you wrote:
>Hi,
>
>A client neets to autmatically submit form data to us from an asp page -
>equivalent funcionality to CFHTTP.
>Does anyone know how this could be done in ASP? (I know virtually nothing
>about ASP!)
>
>Cheers
>
>Dan
>
>Daniel Lancelot
>Web Developer
>Netstep Corporate Communications
>Tel +44 (0) 1422 200308
>Fax +44 (0) 1422 200306
>e-mail: [EMAIL PROTECTED]
>www: http://www.netstep.co.uk
>
><NOTE:  The information contained in this e-mail is intended for the named
>recipient(s) only.  It may also be privileged and confidential.  If you are
>not an intended recipient, you must not copy, distribute or take any action
>in reliance upon it.  No warranties or assurances are made in relation to
>the safety and content of this e-mail and any attachments.  No liability is
>accepted for any consequences arising from it.>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to