How to set the AFNetworking 2.0 default header?
afnetworking, afnetworking-2, ios, objective-c
Solution
You can set header values on the instance of `AFHTTPRequestSerializer` that is assigned to your `AFHTTPSessionManager` (iOS 7) or `AFHTTPRequestOperationManager` (iOS 6) instance. AFNetworking will use the header fields in the request serializer when it builds and executes your requests. You can also subclass `AFHTTPRequestSerializer` to provide default behavior across all instances. See http://cocoadocs.org/docsets/AFNetworking/2.0.0/Classes/AFHTTPRequestSerializer.html
Problem
The following commands work fine with the AFNetworking 1.x library ``` [self registerHTTPOperationClass:[AFJSONRequestOperation class]]; ... [self setDefaultHeader:@"Accept" value:@"application/json"]; ``` What's the equivalent of these functions in AFNetworking 2.0 ? Thanks