I am sending JSON data as request and in response I am getting 0 bytes of data with content type "application/JSON;charset=ISO-8859-1". Why I am getting no response? I think it is related to encoding. Please help.
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", [self getBaseURL], @"FileListIOS"]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setValue:@"application/json" forHTTPHeaderField:@"content-type"];
[request setHTTPMethod:@"POST"];
UserProfile *userProfile = [[AppCacheManager manager] getUserProfile];
NSString *personalPath = userProfile.personalPath;
NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:userProfile.personalPath,userProfile.personalPath,userProfile.userType, nil] forKeys:[NSArray arrayWithObjects:@"currentpath",@"rootpath",@"usertype", nil]];
NSError *error = nil;
NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:&error];
NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
[request setHTTPBody:data];
[NSURLConnection sendAsynchronousRequest:request queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
if(data) {
}
}];