videnda
asked on
Convert coldfusion http post to ASP code.
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("MSXML 2.ServerXM LHTTP")
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeade r "Host", "gateway.textforce.net"
XMLRequest.SetRequestHeade r "Connection", "Keep-Alive"
XMLRequest.SetRequestHeade r "Content-Type", "application/x-www-form-ur lencoded"
%>
Please can someone supply me with the full code?
Regards
Alex
<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("MSXML
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeade
XMLRequest.SetRequestHeade
XMLRequest.SetRequestHeade
%>
Please can someone supply me with the full code?
Regards
Alex
also this link
http://www-level3.experts-exchange.com/questions/20735798/HTTP-Post-syntax-for-posting-XML-to-a-cfm-file.html
i checked the name in the question, it was urs. ??
Regards
Hart
http://www-level3.experts-exchange.com/questions/20735798/HTTP-Post-syntax-for-posting-XML-to-a-cfm-file.html
i checked the name in the question, it was urs. ??
Regards
Hart
ASKER
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.
<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.
Try this:
<%
Set XMLRequest = Server.CreateObject("MSXML 2.ServerXM LHTTP")
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeade r "Host", "gateway.textforce.net"
XMLRequest.SetRequestHeade r "Connection", "Keep-Alive"
XMLRequest.SetRequestHeade r "Content-Type", "application/x-www-form-ur lencoded"
XMLRequest.send("xml=" & Server.URLEncode(xmlout))
%>
<%
Set XMLRequest = Server.CreateObject("MSXML
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeade
XMLRequest.SetRequestHeade
XMLRequest.SetRequestHeade
XMLRequest.send("xml=" & Server.URLEncode(xmlout))
%>
The exact same question was asked in the following question and was answered:
https://www.experts-exchange.com/questions/20735798/HTTP-Post-syntax-for-posting-XML-to-a-cfm-file.html
I see no issues with refunding the points since this is a duplicate question.
https://www.experts-exchange.com/questions/20735798/HTTP-Post-syntax-for-posting-XML-to-a-cfm-file.html
I see no issues with refunding the points since this is a duplicate question.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it has XMLRequest.send XMLString maybe that is what u r missing
https://www.experts-exchange.com/questions/20751743/Display-a-particular-node-in-ASP-VBScript.html
Regards
Hart