Retrieve data from Infinispan via a RESTful interface
Getting data back out HTTP GET and HEAD are used to retrieve data from entries. GET /{cacheName}/{cacheKey} This will return the data found in the given cacheName, under the given key - as the body of the response. A Content-Type header will be supplied which matches what the data was inserted as (other then if it is a Java object, see below). Browsers can use the cache directly of course (eg as a CDN). An ETag will be returned unique for each entry, as will the Last-Modified header field indicating the state of the data at the given URL. ETags allow browsers (and other clients) to ask for data only in the case where it has changed (to save on bandwidth) - this is standard HTTP and is honoured by Infinispan. HEAD /{cacheName}/{cacheKey} The same as GET, only no content is returned (only the header fields). You will receive the same content that you stored. E.g., if you stored a String, this is what you get back. If you stored some XML or JSON, this is what you will receive. If you stored a binary (base 64 encoded) blob, perhaps a serialized Java object - you will need to deserialize this yourself. NOTE: Prior to Infinispan 4.2, the behavior was as follows: If the data in the grid is a Java object - there are a few options in how it can be returned, which use the HTTP Accept header: application/xml - the object will be serialized via XStream to XML representation application/json - the object will be sent via a JSON format (via Jackson) application/x-java-serialized-object - if the object is Serializable, you can use this and get a stream of the Java Serialization form of the object (obviously only makes sense for java clients with a suitable class loaded). If its not Serializable, you have to use one of the other options.