Cómo configurar el tipo de contenido en AFnetworking

Estoy teniendo problemas con AFNetworking. No puedo configurar content-type para la application/json . ¿Como lo puedo hacer? Intento mucha solución, pero nadie ha trabajado. aquí tu eres mi código:

 AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; if (self.enableBasicAuth){ [manager setRequestSerializer:[AFHTTPRequestSerializer serializer]]; [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:[[SOWMerchant merchant] username] password:[[SOWMerchant merchant] password]]; } [manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; manager.responseSerializer = [AFJSONResponseSerializer serializer]; [manager POST:[NSString stringWithFormat:@"%@", url] parameters:postData success:^(AFHTTPRequestOperation *operation, id responseObject) { [self onSuccessResponse:responseObject request:operation]; } failure:^(AFHTTPRequestOperation *operation, NSError *error) { [self onError:error request:operation]; }]; 

Obtengo esta respuesta

 { URL: https://sbengtest.spotonway.com:9099/v1.0/merchant/check }, response: <NSHTTPURLResponse: 0x10aa20530> { URL: https://sbengtest.spotonway.com:9099/v1.0/merchant/check } { status code: 400, headers { Connection = "keep-alive"; "Content-Length" = 192; "Content-Type" = "text/html"; Date = "Sun, 20 Jul 2014 22:34:59 GMT"; Server = "nginx/1.2.1"; } }> 

ACTUALIZAR:

Tengo muchas ganas de agregar esto

 AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer]; [requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"]; operationManagerInstance.requestSerializer = requestSerializer; 

mi locking de la aplicación

ACTUALIZACIÓN 2: funciona. eliminé esta línea

 [requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"]; 

Esto funcionó para mí!

 [requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"]; 

Este código funciona

C objective

 manager.responseSerializer.acceptableContentTypes=[NSSet setWithObject:@"text/html"]; 

rápido

 manager.responseSerializer.acceptableContentTypes=NSSet (object: "text/html") as Set<NSObject>