Currently OC_EH_OK is turned into 2.04 for POST or PUT. This change
does the equivalent for DELETE.
Bug: https://jira.iotivity.org/browse/IOT-2660
Change-Id: I3b64d9c3a9471cdff25160ffab96928e0512fc33
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
{
OIC_LOG(DEBUG, TAG, "Successfully delete resources.");
- EXPECT_EQ(OC_STACK_RESOURCE_CHANGED, clientResponse->result);
+ EXPECT_EQ(OC_STACK_RESOURCE_DELETED, clientResponse->result);
return OC_STACK_DELETE_TRANSACTION;
}
case OC_EH_OK:
case OC_EH_CHANGED: // 2.04
case OC_EH_CONTENT: // 2.05
- if (method == OC_REST_POST || method == OC_REST_PUT || method == OC_REST_DELETE)
+ if (method == OC_REST_POST || method == OC_REST_PUT)
{
caResult = CA_CHANGED;
}
+ else if (method == OC_REST_DELETE)
+ {
+ caResult = CA_DELETED;
+ }
else if (method == OC_REST_GET)
{
caResult = CA_CONTENT;
// GET requests.
ret = CA_CONTENT;
break;
+ case OC_REST_DELETE:
+ // This Response Code is like HTTP 200 "OK" but only used in response to
+ // DELETE requests.
+ ret = CA_DELETED;
+ break;
default:
// This should not happen but,
// give it a value just in case but output an error