Title:
Sending request with application/x-www-form-urlencoded Content-Type causes Jersey error
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/NotABug
Reporter/Name(from Bugbase): Mosh Teitelbaum / Mosh Teitelbaum ()
Created: 04/28/2017
Components: REST Services
Versions: 2016
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2016.0.04.302561 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win 2012 Server x64
Vote Count: 0
Problem Description:
I'm developing an application that uses a REST API, using the built-in ColdFusion REST functionality, for the back-end. Any request sent to the API using a Content-Type of "application/x-www-form-urlencoded" results in a Jersey error (i.e., the request never even reaches my code) with a response of:
{"Message":"Entity input stream has already been closed."}
I've tried submitting requests with a ton of other Content-Type values (e.g., "application/json", "text/plain", even "foo/bar") and they all work fine. It is specifically with a Content-Type of "application/x-www-form-urlencoded" that this error happens.
Steps to Reproduce:
<cfhttp url="http://api.com/rest" method="post" result="httpResult">
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="body" value="foo=bar&this=that" />
</cfhttp>
Actual Result:
Status of "500 Internal Server Error"
Body of {"Message":"Entity input stream has already been closed."}
Expected Result:
Status of "200 OK" or whatever my code produces.
Any Workarounds:
No
Attachments:
Comments: