public
Last active

  • Download Gist
gistfile1.cfm
ColdFusion
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Suggested solution to: http://aqlong.posterous.com/convert-c-sharp-http-post-to-coldfusion-cfhtt
 
 
<cfhttp url="#variables.URL#"
method="post"
throwonerror="true"
redirect="true"
resolveurl="true"
charset="utf-8">
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded">
<cfhttpparam type="formfield" name="data" value="#variables.XML_String#">
</cfhttp>
 
 
 
This is based on
Docs for .Net String.Format - http://msdn.microsoft.com/en-us/library/fht0f5be.aspx
Docs for cfHttpParam - http://cfquickdocs.com/cf8/#cfhttpparam
Sample Post - http://developers.sun.com/mobility/midp/ttips/HTTPPost/
 
 
According to what I can piece together from the sample post link and String.Format docs referenced above, your .Net code should produce something like this:
 
POST /login.jsp HTTP/1.1
Host: www.mysite.com
User-Agent: Mozilla/4.0
Content-Length: 27
Content-Type: application/x-www-form-urlencoded
 
data=escapedHtmlToProducePDF

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.