Guest User

Untitled

a guest
Jun 22nd, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. NSMutableURLRequest *someURLReq = ...
  2. NSString *auth = ...
  3. [someURLReq setValue:auth forHTTPHeaderField:@"Authorization"];
  4.  
  5. NSString *username = ...
  6. NSString *password = ...
  7. NSString *combo = [NSString stringWithFormat:@"%@:%@", username, password];
  8. NSData *comboData = [NSData dataWithBytes:[combo UTF8String] length:combo.length];
  9. NSString *auth = [NSString stringWithFormat:@"Basic %@", [comboData encodeBase64]];
Add Comment
Please, Sign In to add comment