Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableURLRequest *someURLReq = ...
- NSString *auth = ...
- [someURLReq setValue:auth forHTTPHeaderField:@"Authorization"];
- NSString *username = ...
- NSString *password = ...
- NSString *combo = [NSString stringWithFormat:@"%@:%@", username, password];
- NSData *comboData = [NSData dataWithBytes:[combo UTF8String] length:combo.length];
- NSString *auth = [NSString stringWithFormat:@"Basic %@", [comboData encodeBase64]];
Add Comment
Please, Sign In to add comment