How to send login and password to a server using ASIHTTPRequest?

You can pass login details to server using HTTP POST method like this.

You can pass login details to server using HTTP POST method like this : -(NSDictionary*)userLogIn:(NSMutableDictionary*)inputDictionary{ SBJSON *parser = SBJSON alloc init; NSString *convertedString=NSString stringWithFormat:@"login=%@&password=%@",username, password; NSMutableURLRequest *request = NSMutableURLRequest requestWithURL:NSURL URLWithString:@"Give the url here"; request setHTTPBody:convertedString dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES; request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"; request setValue:@"application/json" forHTTPHeaderField:@"Accept"; request setValue:@"XXXX" forHTTPHeaderField:@"USER_AGENT"; request setHTTPMethod:@"POST"; NSData *response = NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil; NSString *json_string = NSString alloc initWithData:response encoding:NSASCIIStringEncoding; NSDictionary *statuses = parser objectWithString:json_string error:nil; parser release; json_string release; return statuses; } This is a sample code and you have to change according to your requirements.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions