Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2016, 07:30 AM
Registered User
 
Join Date: Dec 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default API request and response with classic asp

Hi,

I need to make an API request to a remote server and get some value with the response.

It doesn't work for me.
I get this error:
The download of the specified resource has failed.


This is my code:

strURL = "https://secure5.test.com/cgi-bin/api-url.cgi"

postData=postData & "<?xml version='1.0' encoding='UTF-8'?>"
postData=postData & "<OrderData>"
postData=postData & " <supplier>xyz</supplier>"
postData=postData & " <PW>12345</PW>"
postData=postData & " <op>1</op>"
postData=postData & " <sum>15</sum>"
postData=postData & " <OrderID>11</OrderID>"
postData=postData & "</OrderData>"

Dim objXMLHTTP
Dim strRequest, strResult
strRequest=postData
set objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0")
objXMLHTTP.open "post", "" & strURL & "", False
objXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXMLHTTP.setRequestHeader "Content-Length", Len(strRequest)
objXMLHTTP.setRequestHeader "SOAPAction", strURL
objXMLHTTP.send(strRequest)
strResult = objXMLHTTP.responseText
response.write "strResult:<br>" & strResult

I realy appriciate your help with it.

Thanks,

Kubyustus





Similar Threads
Thread Thread Starter Forum Replies Last Post
First SOAP Request with Classic ASP emmals Classic ASP XML 0 September 22nd, 2014 03:42 AM
Convert classic ASP - Web API code to ASP.NET melvik ASP.NET 3.5 Professionals 0 February 24th, 2012 03:02 PM
Asp .Net 2.0 request/response timeout problem VijayT .NET Framework 2.0 5 February 5th, 2007 01:26 PM
how to send https request in classic asp johndoewn Classic ASP Professional 1 March 25th, 2006 12:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.