Skip to content

Instantly share code, notes, and snippets.

@ardarda
Created May 28, 2015 15:37
Show Gist options
  • Save ardarda/67f8154645ebf3ee5a56 to your computer and use it in GitHub Desktop.
Save ardarda/67f8154645ebf3ee5a56 to your computer and use it in GitHub Desktop.
HTTP Basic Authentication AFNetworking 2.0
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://examplewebsite.com"]];
manager.requestSerializer = [AFHTTPRequestSerializer serializer];
[manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"userName" password:@"password"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment