错误不可接受的内容类型:application / xml

时间:2017-09-30 18:15:32

标签: ios objective-c

我的代码是:

AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html",nil];
[manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

我收到了错误:

  

不可接受的内容类型:application / xml

0 个答案:

没有答案