Skip to content

Instantly share code, notes, and snippets.

@mjclemente
Last active February 22, 2018 20:34
Show Gist options
  • Save mjclemente/d8db19dcecf072afc0c6143e26ae2b97 to your computer and use it in GitHub Desktop.
Save mjclemente/d8db19dcecf072afc0c6143e26ae2b97 to your computer and use it in GitHub Desktop.
PUT/PATCH request body being lost on Windows Server, IIS 8... but not with built-in web server

When I run the following with ColdFusion's built-in web server, the content of the request shows the request body

When I run it on a Windows Server, running IIS 8, the request body is empty. That is, the body of the PUT or PATCH request is lost. POSTs are handled without issue.

Also, it doesn't matter if the PUT/PATCH originates from ColdFusion or from an external source, like Postman; the result is the same.

In both cases, I'm running ACF 11.

Content of index.cfm


<cfoutput>
	<cfscript>
		cfhttp( method="PUT", url="http://127.0.0.1:61973/showrequest.cfm", result="result" ) {
		    cfhttpparam( type = "header", name = 'Content-Type', value = 'application/json' );
		    cfhttpparam( type="body", value="#serializeJson( { 'test' : 1 } )#" );
		}
		writeOutput( result.filecontent );
	</cfscript>
</cfoutput>

Content of file requested (showrequest.cfm)


<cfoutput>
<cfdump var="#getHttpRequestData()#" format="html" abort="true">
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment