Add support for Content-Type application/hal+json

Currently when the server responds with a content type of application/hal+json, the response might be 200 but the AFNetwork will call the fail callback anyway because the content type is not acceptable.
This commit is contained in:
Ryan de Gruyter
2017-10-09 13:34:40 +02:00
committed by GitHub
parent 807af7adfa
commit 190c44b30a
+2 -2
View File
@@ -23,7 +23,7 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co
return nil;
}
self.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"text/html", @"text/json", @"application/json", @"text/xml", @"application/xml", @"text/css", nil];
self.acceptableContentTypes = [NSSet setWithObjects:@"text/plain", @"text/html", @"text/json", @"application/hal+json", @"application/json", @"text/xml", @"application/xml", @"text/css", nil];
return self;
}
@@ -55,4 +55,4 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co
return responseString;
}
@end
@end