iOS/OC: AFN做微信登录时报错NSLocalizedDescription=Request failed: unacceptable content-type: text/plain

AFN做微信登录时回调failure,
error信息如下:
...
NSLocalizedDescription=Request failed: unacceptable content-type: text/plain
...

解决办法:
在AFN源码AFURLResponseSerialization.m 第228行增加一个@"text/plain"
如下:

- (instancetype)init {
    self = [super init];
    if (!self) {
        return nil;
    }

    self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/plain",nil];

    return self;
}

你可能感兴趣的:(iOS/OC: AFN做微信登录时报错NSLocalizedDescription=Request failed: unacceptable content-type: text/plain)