AFNetworking 2.x 设置header

  1. AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];  
  2. manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];  
  3. manager.requestSerializer = [AFJSONRequestSerializer serializer];  
  4. manager.responseSerializer = [AFJSONResponseSerializer serializer];  
  5. [manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];  
  6. [manager.requestSerializer setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; 

你可能感兴趣的:(AFNetworking 2.x 设置header)