NSDictionary *parameters=[[NSDictionary alloc]initWithObjectsAndKeys:@"1",@"brand.brand_id",
@"1",@"city.city_id",
@"9911223344",@"mobile",
@"aravind",@"first_name",
@"Buddarapu",@"last_name",
@"anand@gmail.com",@"email",
@"21-12-1991",@"date_of_birth",
@"Male",@"gendername",
@"0",@"isadmin",
@"1",@"location.location_id",
@"1",@"organization.organization_id",
@"helloIndia",@"passwordhash",
@"1",@"preference.preference_id",
@"1",@"state",
@"BAnand",@"username",
@"",@"verifypass",nil];
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
AFJSONRequestSerializer *serializer = [AFJSONRequestSerializer serializer];
[serializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[serializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
manager.requestSerializer = serializer;
[manager POST:@"http://*.***.**.***:****/SaveCustomer" parameters:parameters success:^(NSURLSessionDataTask * task, id responseObject) {
NSLog(@"Responce is :%@",responseObject);
} failure:^(NSURLSessionDataTask * task, NSError * error) {
NSLog(@"error %@",error);
}];
}
While calling server am getting this error.
error Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}