Open vats-ashish opened 11 months ago
I figured this out. First get the item by passing the same url and then delete the item by passing the url as, item.url into Delete()
var fileItem = await _sfClient.Items.Get(fileUrl).ExecuteAsync(cancellationToken); await _sfClient.Items.Delete(item.url).ExecuteAsync(cancellationToken);
While trying to delete a file uploaded to a folder I made a call Delete() calling like-
await _sfClient.Items.Delete(fileUrl).ExecuteAsync(cancellationToken);
_sfclient is injected into the class and I am authenticating the client right before the Delete call.The file is getting deleted successfully but after the execution completed I am getting the below exception.
Name $exception
Value {"Unable to retrieve HttpResponseMessage.Content"} Type ShareFile.Api.Client.Exceptions.InvalidApiResponseException
stacktrace:
the API troubleshooting documentation clearly says ,
But why this is throwing the exception? this is getting logged in my app insight every time I try to delete the file passing the Uri.
How to just simply delete the file without any exception?