(Go) Shopify Delete Product
Delete a product from the shop.
rest := chilkat.NewRest()
var success bool
rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY")
success = rest.Connect("chilkat.myshopify.com",443,true,true)
if success != true {
fmt.Println(rest.LastErrorText())
rest.DisposeRest()
return
}
sbResponse := chilkat.NewStringBuilder()
success = rest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",sbResponse)
if success != true {
fmt.Println(rest.LastErrorText())
rest.DisposeRest()
sbResponse.DisposeStringBuilder()
return
}
if rest.ResponseStatusCode() != 200 {
fmt.Println("Received error response code: ", rest.ResponseStatusCode())
fmt.Println("Response body:")
fmt.Println(*sbResponse.GetAsString())
rest.DisposeRest()
sbResponse.DisposeStringBuilder()
return
}
fmt.Println("Example Completed.")
rest.DisposeRest()
sbResponse.DisposeStringBuilder()
|