ios - 无法删除 Box v2 api 中的文件

标签 ios objective-c box

我按照以下 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/

相关文章:

ios - ActionSheetPickerClass , iOS

iphone - 存在 iCloud 帐户时 MFMailComposeViewController 中的错误?

ios - box-ios-preview-sdk : Memory leak in pspdfkit

ios - 是否可以在不显示 MPMediaPickerController 的情况下显示 ios 中的所有歌曲

line - 用Ghostscript绘制矩形(使用PostScript语言)

javascript - 如何在 R 中的同一箱形图上绘制来自一个数据集的 2 组分类数据

ios - 使用 NSKeyedArchiver 归档和取消归档时是否保留引用?

ios - 如何使 subview 适合HStack中所有可用的垂直空间?

ios - 使用 CKReference 与 CKRecord 的 CloudKit 性能

objective-c - 了解协议(protocol)和委托(delegate)之间的关系