Box 2.0 APIObjective CクライアントからBoxフォルダにファイルをアップロードするためにしばらく試してみました。私はいくつかの投稿を読みました:
Curlドキュメントに記載されているように、 を正常に使用しようとしましたが、 NSMutableUrlRequest. これは私のコードです:
NSURL *URL = [NSURL URLWithString:@"https://api.box.com/2.0/files/content"];
    urlRequest = [[NSMutableURLRequest alloc]
                  initWithURL:URL cachePolicy:NSURLRequestReloadIgnoringCacheData
                  timeoutInterval:30];
    [urlRequest setHTTPMethod:@"POST"];
    AppDelegate *appDelegate = [AppDelegate sharedDelegate];
    NSString *p = [NSString stringWithFormat:@"BoxAuth api_key=%@&auth_token=%@",API_KEY,appDelegate.boxAuthToken];
    [urlRequest setValue:p forHTTPHeaderField:@"Authorization"];
    [urlRequest setValue:@"multipart/form-data, boundary=AaB03x" forHTTPHeaderField:@"Content-Type"];
    NSString *postBody = @"--AaB03x"
            @"content-disposition: form-data; name=\"filename\"; filename=\"test.txt\";"
            @"folder_id=466838434"
            @"Content-type: text/plain"
            @""
            @"testing box api 2.0"
            @""
            @"--AaB03x--";
    NSData *data = [postBody dataUsingEncoding:NSUTF8StringEncoding];
    [urlRequest setHTTPBody:data];
    [urlRequest setValue:[NSString stringWithFormat:@"%d",[data length]] forHTTPHeaderField:@"Content-Length"];