Use NSURLSession.

This commit is contained in:
Damiano Galassi committed 2017-03-31 13:05:35 +02:00
1 parent 6e391ccbff
commit edefa3350e
3 files changed
+30 -36

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.chapterdb.org/chapters/search?title=%@", [SBMetadataHelper urlEncoded:title]]];
NSDictionary *headerOptions = @{@"ApiKey" : API_KEY};
self.task = [SBMetadataHelper sessionTaskFromUrl:url withHTTPMethod:@"GET" headerOptions:headerOptions completionHandler:^(NSData * _Nullable data) {
self.task = [SBMetadataHelper sessionTaskFromUrl:url HTTPMethod:@"GET" headerOptions:headerOptions cachePolicy:NSURLRequestUseProtocolCachePolicy completionHandler:^(NSData * _Nullable data) {
NSXMLDocument *xml = [[NSXMLDocument alloc] initWithData:data
options:0
error:NULL];