mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Return the appropriate status code from XHR
This commit is contained in:
1 parent
ca9f1e5e95
commit
b66424ebe4
1 file changed
+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]};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user