The new ARNetworking 2.0 architecture uses serializers to create queries and analyze parsing. To configure the authorization header, you must first initialize the request operation manager, which replaces AFHTTPClient, create a serializer, and then call the dedicated method to set the header.
For example, the code would look like this:
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:[NSURL URLWithString:@"http://examplewebsite.com"]]; manager.requestSerializer = [AFHTTPRequestSerializer serializer]; [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:@"userName" password:@"password"];
You should read the documentation and the migration guide to understand the new concepts that come with AFNetworking version 2.0.
Leguman 01 Oct '13 at 8:48 2013-10-01 08:48
source share