AFN Code=-1016 "Request failed: unacceptable content-type: text/html"

AFN请求失败报错:
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html"

1.接收对象里添加 @"text/html"

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

2.去掉

  self.responseSerializer = [AFJSONResponseSerializer serializer];

你可能感兴趣的:(AFN Code=-1016 "Request failed: unacceptable content-type: text/html")