我可以使用httpclient API删除Azure中的文件,但是如何使用httpclient API删除Azure的datalake Store中的目录?
文件删除代码
private const string DeleteUrl = "https://{0}.azuredatalakestore.net/webhdfs/v1/{1}?op=DELETE";
public string DeleteFile(string path)
{
var deleteUrl = string.Format(DeleteUrl, _datalakeAccountName, path);
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _accesstoken.access_token);
var res = client.DeleteAsync(deleteUrl).Result;
var data = res.Content.ReadAsStringAsync().Result;
return data;
}
}