void createResource()
{
std::string resourceURI = "/a/TempHumSensor/hosting";
- std::string resourceTypeName = "resource.hosting";
+ std::string resourceTypeName = "oic.r.resourcehosting";
std::string resourceInterface = DEFAULT_INTERFACE;
m_uri = resourceURI;
{
std::string resourceURI = "/a/NM/TempHumSensor1"; // URI of the resource
std::string resourceTypeName =
- "notificationmanager.hosting"; // resource type name. In this case, it is light
+ "oic.r.resourcehosting"; // resource type name.
std::string resourceInterface = DEFAULT_INTERFACE; // resource interface.
// OCResourceProperty is defined ocstack.h
else if (requestType == "POST")
{
cout << "\t\t\trequestType : POST\n";
+ OCRepresentation rep = request->getResourceRepresentation();
+ myResource.put(rep);
+
+ if (pResponse)
+ {
+ pResponse->setErrorCode(200);
+ pResponse->setResourceRepresentation(myResource.get());
+ }
+ if (OC_STACK_OK == OCPlatform::sendResponse(pResponse))
+ {
+ ehResult = OC_EH_OK;
+ }
+ else
+ {
+ cout << "post request Error\n";
+ }
}
else if (requestType == "DELETE")