(Unicode C++) Shopify Delete Product
Delete a product from the shop.
#include <CkRestW.h>
#include <CkStringBuilderW.h>
void ChilkatSample(void)
{
CkRestW rest;
bool success;
rest.SetAuthBasic(L"SHOPIFY_PRIVATE_API_KEY",L"SHOPIFY_PRIVATE_API_SECRET_KEY");
success = rest.Connect(L"chilkat.myshopify.com",443,true,true);
if (success != true) {
wprintf(L"%s\n",rest.lastErrorText());
return;
}
CkStringBuilderW sbResponse;
success = rest.FullRequestNoBodySb(L"DELETE",L"/admin/products/#{id}.json",sbResponse);
if (success != true) {
wprintf(L"%s\n",rest.lastErrorText());
return;
}
if (rest.get_ResponseStatusCode() != 200) {
wprintf(L"Received error response code: %d\n",rest.get_ResponseStatusCode());
wprintf(L"Response body:\n");
wprintf(L"%s\n",sbResponse.getAsString());
return;
}
wprintf(L"Example Completed.\n");
}
|