Copy link to clipboard
Copied
Started seeing some weird message today in my CF18 environment. The message is "The @FormParam is utilized when the content type of the request entity is not application/x-www-form-urlencoded" when calling a CF REST service in a cfc file. This has worked as recent as a week ago so not sure why it would be an issue now. Has anyone expereicned this before? The call we make to the REST service is shown below. I am thinking it is related to tthe headers but not sure if that value should be something different.
$http({
method: 'POST',
url: strServiceUrl + 'admin/create/' + $scope.selectedRecall.id + '/retailblock/remove',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
Thanks.
Copy link to clipboard
Copied
I'm having this issue too. Did you ever figure out the solution?
Copy link to clipboard
Copied
Hi Phil5C93. I honestly don't remember what was done to fix this. I am looking at that block of code now and it is working and is the same as I show above. The CFC that it references has this for the cfconponent "<cfcomponent output="false" rest="true" restPath="admin/create">". I know on some of my CFC's I have to actually put rest="true" but not sure if that is what we did to fix this issue. You can try it to see if it works, just change the rest path to whatever your path is. I'll check a few other things to see if it jogs my memory. Also, I am running CF2018 Enterprise update 9 on the server this is running on.
Copy link to clipboard
Copied
Phil, what cf version are you on? 2018 as well? and what update?
And jd, are you still having the issue? If so, what update of cf2018?
Copy link to clipboard
Copied
@Jdsplicer , I have posted a response in Phil5C93's @FormParam thread. I shall repeat it here for your convenience:
@FormParam is shorthand for the annotation @javax.ws.rs.FormParam in Java's standard REST API, JAX-RS. ColdFusion 2018's REST API ia an implementation of JAX-RS.
@FormParam requires that the request body of the input be of type application/x-www-form-urlencoded. That is, it requires that your service receive input from an HTML form. This in turn implies that the value of the request's Content-Type header must be application/x-www-form-urlencoded.
The 2 most likely causes of the error are therefore:
The likeliest scenario, to cut a long story short:
Copy link to clipboard
Copied
There is a break in backward compatibility. So, all said and done, what you have observed might be a bug.