i m new in IOS development. i am requesting to web service which is having POST method and accept two parameters password and confirmation in header. this is url https://abc.xyz.eu/pqr/Api this is the method api/Account/ChangePassword?password={password}&confirmation={confirmation}
how to call this method i have tried lots of code but getting 400,401,404 error
finally i am getting 200 status code in chrome by using basic authentication .now problem is that i am confused how to pass values of basic authentication and header parameters plz help me `
NSString *UrlWithParameters=[NSString stringWithFormat:@"https://abc.xyz.eu/abc/api/Account/ChangePassword?"];
NSURL *ServiceURL =[NSURL URLWithString:UrlWithParameters];
NSMutableURLRequest * request =[NSMutableURLRequest requestWithURL:ServiceURL];
NSString *post = [NSString stringWithFormat:@"password=%@&confirmation=%@",self.txtNewPassord.text,self.txtConPassord.text];
NSData* postData = [post dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPMethod:@"POST"];
NSString *authValue = [NSString stringWithFormat:@"Basic %@",self.appDelegate.UserPasswordBase64];
[request setValue:authValue forHTTPHeaderField:@"Authorization"];
[request setValue:@"application/json" forHTTPHeaderField:@"accept"];
[request setValue:@"application/json" forHTTPHeaderField:@"content-type"];
[request setHTTPBody:postData];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
`