我收到 NSURLErrorDomain Code=-1021 “请求正文流已用尽”
NSLocalizedDescription=请求体流耗尽,NSUnderlyingError=0x2088c080 "请求体流耗尽"}
上传多张大尺寸图片时出现此错误我正在使用AFNetworking并尝试在线搜索修复,但没有成功
NSDictionary *clientUniqueId = [NSDictionary dictionaryWithObject:NSLocalizedString(uniqueDrId, nil) forKey:@"clientUniqueId"];
NSMutableURLRequest *request = [client multipartFormRequestWithMethod:@"POST"
path:pendingUpload.urlPath
parameters:clientUniqueId
constructingBodyWithBlock:^(id<AFMultipartFormData> formData)
{
[formData appendPartWithFormData:[pendingUpload dataRecordData] name:@"dr"];
NSArray *attachments = pendingUpload.attachments;
if (attachments != nil) {
for (Attachment *attachment in attachments) {
[formData appendPartWithFileData:attachment.data
name:attachment.key
fileName:attachment.filename
mimeType:attachment.contentType];
}
}
}];