Skip to content

Instantly share code, notes, and snippets.

@acterry
Created March 29, 2010 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acterry/347940 to your computer and use it in GitHub Desktop.
Save acterry/347940 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment