Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 21st, 2016, 08:30 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
First SOAP Request with Classic ASP emmals Classic ASP XML 0 September 22nd, 2014 04: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



All times are GMT -4. The time now is 07:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.