无法解析 JSON 响应中的响应

Not able to parse response in JSON response

我正在使用 AFNetworking 3,Xcode 7.2 用于 iOS 9。

AFURLSessionManager *ses = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
ses.responseSerializer = [AFJSONResponseSerializer serializer];

//Request
[[AFJSONRequestSerializer serializer] setValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSMutableURLRequest *request = [[AFJSONRequestSerializer serializer] requestWithMethod:@"GET" URLString:endPoint parameters:parameters error:nil];

NSURLSessionDataTask *dataTask = [ses dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@ %@", response, responseObject);
    }
}];
[dataTask resume];

但我收到的错误响应为:

Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/plain"

请求内容类型仍设置为"text/plain" 我不确定我错过了什么。

我使用了 http 响应序列化程序本身,它运行良好。

AFURLSessionManager *ses = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
    ses.responseSerializer = [AFHTTPResponseSerializer serializer];

NSMutableDictionary * innerJson = [NSJSONSerialization
                                               JSONObjectWithData:responseObject options:kNilOptions error:&error1];