Ios 未能删除box v2 api中的文件

Ios 未能删除box v2 api中的文件,ios,objective-c,box,Ios,Objective C,Box,我按照下面url中给出的步骤删除box api中的文件和文件夹 我正在使用以下代码删除box api中的文件。我成功删除文件夹,但删除文件失败 NSString *str; if ([type isEqualToString:@"folder"]) { str = [NSString stringWithFormat:@"https://api.box.com/2.0/folders/%@?recursive=true&access_token=%

我按照下面url中给出的步骤删除box api中的文件和文件夹

我正在使用以下代码删除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 ;

找到解决办法了。小错误

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 ;

你做得对,但犯了一个小错误。需要安置吗?而不是&在下面的行中

str =  [NSString stringWithFormat:@"https://api.box.com/2.0/files/%@?access_token=%@&If-Match=%@",folder_id,str_access_token,etag];