Coldfusion 8 and HTTP PUT - is there a way to PUT an object?
Posted
by ciaranarcher
on Stack Overflow
See other posts from Stack Overflow
or by ciaranarcher
Published on 2010-03-25T17:09:09Z
Indexed on
2010/03/25
20:33 UTC
Read the original article
Hit count: 189
Hi all
We are using EHCache with CF 8 to cache stuff on a central server using a RESTful interface over HTTP. I am trying to cache a cfquery object to the cache server.
I can get this to work if I call EHCache direct (i.e. store it in a local cache) but if I try to cache on a remote server over HTTP I am running into problems.
The code I am using is as follows:
<cfhttp url="http://localhost:8080/myCache/myKey"
method="put"
result="r"
timeout="2"
throwonerror="true" >
<cfhttpparam type="body" value="#ARGUMENTS.item#" />
</cfhttp>
CF doesn't like this reference to #ARGUMENTS.item#
and it complains Complex object types cannot be converted to simple values.
Can anyone give me an example of how to put an object over http using CF? If this is not possible with CF then a Java example would be the next best thing.
Many thanks in advance!
PS: I do not want to use serialization to text/JSON etc. as this approach has issues with data integrity and most importantly it's not fast enough.
© Stack Overflow or respective owner