我按照以下 url 中给出的过程删除 box api 中的文件和文件夹。
http://developers.box.com/docs/#files-delete-a-file
http://developers.box.com/docs/#folders-delete-a-folder
我正在使用以下代码删除 box api 中的文件。我删除文件夹成功,但删除文件失败。
NSString *str;
if ([type isEqualToString:@"folder"])
{
str = [NSString stringWithFormat:@"https://api.box.com/2.0/folders/%@?recursive=true&access_token=%@",folder_id,str_access_token];
}
else
{
str = [NSString stringWithFormat:@"https://api.box.com/2.0/files/%@&access_token=%@&If-Match=%@",folder_id,str_access_token,etag];
}
ASIFormDataRequest *postParams = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:str]];
[postParams setRequestMethod:@"DELETE"];
[postParams startAsynchronous];
postParams.delegate = self ;
最佳答案
你做对了,但有一个小错误。需要放置吗?而不是下面 lline 中的 &。
str = [NSString stringWithFormat:@"https://api.box.com/2.0/files/%@?access_token=%@&If-Match=%@",folder_id,str_access_token,etag];
关于ios - 无法删除 Box v2 api 中的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25337470/