Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions BaasBox-iOS-SDK/BAAClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,12 @@ - (void)getPath:(NSString *)path

[[self.session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {


if(response == nil){
failure(error);
return;
}

NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
Expand Down Expand Up @@ -1530,7 +1535,12 @@ - (void)postPath:(NSString *)path

[[self.session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {


if(response == nil){
failure(error);
return;
}

NSHTTPURLResponse *r = (NSHTTPURLResponse*)response;
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
Expand Down Expand Up @@ -1570,7 +1580,12 @@ - (void)putPath:(NSString *)path
parameters:parameters];
[[self.session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {


if(response == nil){
failure(error);
return;
}

NSHTTPURLResponse *r = (NSHTTPURLResponse*)response;
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
Expand Down Expand Up @@ -1610,7 +1625,12 @@ - (void)deletePath:(NSString *)path
parameters:parameters];
[[self.session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {


if(response == nil){
failure(error);
return;
}

NSHTTPURLResponse *r = (NSHTTPURLResponse*)response;
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
Expand Down