Solved

Convert coldfusion http post to ASP code.

Posted on 2003-10-27
8
267 Views
Last Modified: 2013-12-24
I have been supplied with the following coldfusion code, I know that it works for what I need:

<cfhttp url             = "http://gateway.textforce.net/sendsms.cfm"
                      method          = "POST"
                      port            = "80"
                      resolveurl      = "false"
                      throwonerror    = "yes">
<cfhttpparam type="FormField" name="xml" value="#xmlout#">
</cfhttp>

I need the equivalent code in ASP.
I already have this, but it is missing some of the parts above.
(especially how to post the form field)

<%
Set XMLRequest = Server.CreateObject("MSXML2.ServerXMLHTTP")
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeader "Host", "gateway.textforce.net"      
XMLRequest.SetRequestHeader "Connection", "Keep-Alive"
XMLRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
%>

Please can someone supply me with the full code?

Regards

Alex
0
Comment
Question by:videnda
8 Comments
 
LVL 11

Expert Comment

by:hart
ID: 9626360
chack this link out
it has XMLRequest.send XMLString maybe that is what u r missing

http://www.experts-exchange.com/Web/Web_Languages/XML/Q_20751743.html

Regards
Hart
0
 
LVL 11

Expert Comment

by:hart
ID: 9626374
also this link
http://www-level3.experts-exchange.com/Web/Web_Languages/XML/Q_20735798.html

i checked the name in the question, it was urs. ??

Regards
Hart
0
 
LVL 11

Expert Comment

by:hart
ID: 9626387
als check this link out
http://www.codetoad.com/forum/18_22621.asp

Regards
hart
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:videnda
ID: 9626810
The code you are refering to from a previous question is to post a string.  I am now asking how to set the other parameters, fopr example the throwonerror, and in particular how to post the string as a form field named 'xml' with a value set as the string as in the following code.

<cfhttp url             = "http://gateway.textforce.net/sendsms.cfm"
                     method          = "POST"
                     port            = "80"
                     resolveurl      = "false"
                     throwonerror    = "yes">
<cfhttpparam type="FormField" name="xml" value="#xmlout#">

Thanks for your help so far.
0
 
LVL 9

Expert Comment

by:shooksm
ID: 9628958
Try this:

<%
Set XMLRequest = Server.CreateObject("MSXML2.ServerXMLHTTP")
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeader "Host", "gateway.textforce.net"    
XMLRequest.SetRequestHeader "Connection", "Keep-Alive"
XMLRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
XMLRequest.send("xml=" & Server.URLEncode(xmlout))
%>
0
 
LVL 9

Expert Comment

by:shooksm
ID: 9732741
The exact same question was asked in the following question and was answered:

http://www.experts-exchange.com/Web/Web_Languages/XML/Q_20735798.html

I see no issues with refunding the points since this is a duplicate question.
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 9755492
PAQed, with points refunded (50)

SpazMODic
EE Moderator
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Server with multiple sites and SSL 14 67
Redundant SQL Servers Without Clustering 7 121
.htaccess rewrite url with querystring problem 13 102
I starting with php 12 137
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question