mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
[ReactNative] Return the appropriate status code from XHR
This commit is contained in:
parent
d6a031b431
commit
1289536fe1
@ -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]};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user