Merge pull request #169 from andrewimm/master

Return the appropriate status code from XHR
This commit is contained in:
Tadeu Zagallo 2015-03-19 15:45:25 +00:00
Родитель ca9f1e5e95 b66424ebe4
Коммит c656cd9f24
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -50,8 +50,9 @@
} else {
encoding = NSUTF8StringEncoding;
}
int responseCode = (int)[((NSHTTPURLResponse *)response) statusCode];
NSString *returnData = [[NSString alloc] initWithData:data encoding:encoding];
responseJSON = @{@"status": @200, @"responseText": returnData};
responseJSON = @{@"status": @(responseCode), @"responseText": returnData};
} else {
responseJSON = @{@"status": @0, @"responseText": [connectionError localizedDescription]};
}