Image upload using AFMultipartFormData AFNetworking 3.0
问题 NSURL *URL = [NSURL URLWithString:@"some APi"]; AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; manager.responseSerializer = [AFHTTPResponseSerializer serializer]; UIImage *myImageObj = [UIImage imageNamed:@"avatar.jpg"]; NSData *imageData= UIImagePNGRepresentation(myImageObj); [manager POST:URL.absoluteString parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { [formData appendPartWithFileData:imageData name:@"file" fileName:@"avatar.jpg" mimeType:@