Skip to content

product is deleted in db from rest api but json response is 'Requested product doesn't exist'  #9148

@LakshmanKatragadda

Description

@LakshmanKatragadda
  1. php 7.0.15
  2. mysql 5.6
    3.magento 2.1.5
$setHaders = array('Content-Type:application/json','Authorization:Bearer '.$token);
$product_sku='24-MB04';


$requestURL = "http://x.x.x.x/magento/rest/V1/products/".$product_sku;
echo $requestURL;
$ch = curl_init();      
curl_setopt($ch,CURLOPT_URL, $requestURL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $setHaders);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if(curl_exec($ch)===false){
    echo "Curl error: " . curl_error($ch)."\n";
}else{
    $response = curl_exec($ch) ?: "";
}
curl_close($ch);

print_r($response);

capture

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions