I am trying to create a Http request using AFNetworking that send some variables and file to server using AFNetworking. but it is not sending files and Variables too.
The request get hit to server but it does not take any parameter or file with it, i double checked it file url and parameters dic is not empty
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];