Delete Key/Value Pair

delete

/ccs/{cacheName}/{key}

Deletes a key/value pair from a cache.

Request

Path Parameters
cacheName
Type: string
Required: true
Name of cache
key
Type: string
Required: true
Key for the key/value pair to be deleted
Query Parameters
returnOld
Type: boolean
Specifies whether the old value should be returned

Response

200 Response
Successful response
Body
Root Schema : value
Type: string (binary)
Title: value
If old value requested
204 Response
Sent if returnOld = true, but no old value exists

Examples

The following example shows how to delete a key from an Oracle Application Cloud Service cache by submitting a DELETE request on the REST resource using Java code. For the full application, see Sample Application.

Response deleteResponse = target
        .path(CACHE_NAME + "/" + testKey)
        .request()
        .delete();

Example of Response Header

The following shows an example of the response header. The zero content length indicates that the value that was associated with the key was not returned in the response body. This occurred because returnOld was not set or set to false.

HTTP/1.1 200 OK 
Content-Type: application/octet-stream 
Date: Wed, 04 Jan 2017 16:45:29 GMT 
Content-Length: 0

Example of Response Body

The following shows an example of a response body, which only exists if returnOld is set to true. It’s a string that contains the value associated with the deleted key. In this case, the value associated with the deleted key was the string TheAssociatedValue.

TheAssociatedValue