AFNetworking 请求头的设置

  1. AFHTTPRequestOperationManager*manager=[AFHTTPRequestOperationManagermanager];
  2. manager.securityPolicy=[AFSecurityPolicypolicyWithPinningMode:AFSSLPinningModeNone];
  3. manager.requestSerializer=[AFJSONRequestSerializerserializer];
  4. manager.responseSerializer=[AFJSONResponseSerializerserializer];
  5. [manager.requestSerializersetValue:@"application/json"forHTTPHeaderField:@"Accept"];
  6. [manager.requestSerializersetValue:@"application/json;charset=utf-8"forHTTPHeaderField:@"Content-Type"]; 

你可能感兴趣的:(iOS)