我正在尝试使用AFNetworking创建一个Http请求,它使用AFNetworking将一些变量和文件发送到服务器。但它也没有发送文件和变量。
请求被命中到服务器但它不带任何参数或文件,我仔细检查它的文件URL和参数dic不是空的
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:[NSString stringWithFormat:@"com.app316.MWPl.backgroundconfiguration"] ];
configuration.sharedContainerIdentifier=kGroupNameToShareData;
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
AFHTTPRequestSerializer *serializer = [AFHTTPRequestSerializer serializer];
//parameters is NSDictionary With values in it
NSMutableURLRequest *requesting=[serializer requestWithMethod:@"POST" URLString:urlString parameters:parameters error:&error99];
NSURLSessionUploadTask *uploadTask4 =[manager uploadTaskWithRequest:requesting fromFile:storeURL progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error)
{
if (error)
{
NSLog(@"Error: %@", error);
NSLog(@"Responce== %@", response);
NSLog(@"Success: =%@", responseObject);
}
else
{
NSLog(@"Success: %@ %@", response, responseObject);
}
}];
[uploadTask4 resume];