iOS - AFNetworking之多图片/文件上传 表单提交 二进制流

//设置网络请求管理者  
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];  
   //发送网络请求  
   [manager POST:url parameters:paramsDic constructingBodyWithBlock:^(id formData) {  
     for (int i = 0; i < self.imageArr.count; i++) {  
       UIImage *image = self.imagArr[i];  
       NSData *data = UIImagePNGRepresentation(image);  
       [formData appendPartWithFileData:data name:[NSString stringWithFormat:@"photos[%d]",i] fileName:[NSString stringWithFormat:@"image%d.png",i] mimeType:@"image/png"];  
     }  
    } success:^(AFHTTPRequestOperation *operation, id responseObject) {  
  
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {  
          
    }];  

你可能感兴趣的:(iOS - AFNetworking之多图片/文件上传 表单提交 二进制流)