AFhttpRequestoperationManager *manager = [AFhttpRequestoperationManager manager];manager.requestSerializer = [AFJsONRequestSerializer serializer];[manager.requestSerializer setValue:@"Bearer #_token_goes_here#" forhttpheaderFIEld:@"Authorization"];NSDictionary *parameters = @{@"snippet" : @{@"Title" : @"random_Title",@"description" : @"random_description"}};NSURL *filePath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"vIDeo" ofType:@"mov"]];[manager POST:@"https://www.GoogleAPIs.com/upload/youtube/v3/vIDeos?part=snippet,status" parameters:parameters constructingBodyWithBlock:^(ID<AFMultipartFormData> formData) { [formData appendPartWithfileURL:filePath name:@"vIDeo" filename:@"vIDeo.mov" mimeType:@"vIDeo/*" error:NulL];} success:^(AFhttpRequestoperation *operation,ID responSEObject) { NSLog(@"Success: %@",responSEObject);} failure:^(AFhttpRequestoperation *operation,NSError *error) { NSLog(@"Error: %@",error);}];
如何正确设置请求的JsON参数?
谢谢.
以上是内存溢出为你收集整理的ios – 使用AFNetworking 2.0将视频上传到youtube全部内容,希望文章能够帮你解决ios – 使用AFNetworking 2.0将视频上传到youtube所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)