From b66424ebe4fc12417039fe1eaf137d70049834de Mon Sep 17 00:00:00 2001 From: Andrew Imm Date: Thu, 19 Mar 2015 02:02:51 -0700 Subject: [PATCH] Return the appropriate status code from XHR --- Libraries/Network/RCTDataManager.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Network/RCTDataManager.m b/Libraries/Network/RCTDataManager.m index 4ffe5f975a7e20..9bfd9824ba4595 100644 --- a/Libraries/Network/RCTDataManager.m +++ b/Libraries/Network/RCTDataManager.m @@ -50,8 +50,9 @@ - (void)executeQuery:(NSString *)queryType } 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]}; }