Store Value
put
/ccs/{cacheName}/{key}
Stores the value and associates it with the specified key.
Request
Path Parameters
- cacheName
-
Type:
string
Required:true
Name of cache- key
Type:string
Required:true
Key for the key/value pair to be stored
Query Parameters
- returnOld
-
Type:
boolean
Specifies whether the old value should be returned- ttl
Type:integer
(int64
)Time to live of entry in milliseconds
Body Parameter
New value to be associated with the key
Root Schema : /paths/~1{cacheName}~1{key}/put/parameters/4/schema
Type:
string
(binary
)Response
200 Response
Successful response
Body
Root Schema : value
Type:
string
(binary
)Title:
value
Sent if returnOld = true
204 Response
Sent if returnOld = false (or missing) or if returnOld = true and no old value exists
Examples
The following example shows how to store a value in an Oracle Application Cloud Service cache by submitting a PUT request on the REST resource using Java code. For the full application, see Sample Application.
Response putResponse = target .path(CACHE_NAME + "/" + testKey) .request(MediaType.APPLICATION_OCTET_STREAM) .put(Entity.entity(testValue, MediaType.TEXT_PLAIN));
If the cache referenced by CACHE_NAME doesn’t exist, it is created automatically.
Example of Response Header
The following shows an example of the response header. There is no response body.
HTTP/1.1 204 No Content Date: Wed, 04 Jan 2017 16:41:28 GMT