mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 12:25:59 +08:00
Implemented response headers when using XMLHttpRequest
Summary: I think perhaps these were left out by mistake? Closes https://github.com/facebook/react-native/pull/382 Github Author: Mike Driver <mikedriver@gmail.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
+ (NSDictionary *)NSDictionary:(id)json;
|
||||
+ (NSString *)NSString:(id)json;
|
||||
+ (NSNumber *)NSNumber:(id)json;
|
||||
+ (NSData *)NSData:(id)json;
|
||||
|
||||
+ (NSURL *)NSURL:(id)json;
|
||||
+ (NSURLRequest *)NSURLRequest:(id)json;
|
||||
|
||||
@@ -50,6 +50,12 @@ RCT_CONVERTER(NSString *, NSString, description)
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (NSData *)NSData:(id)json
|
||||
{
|
||||
// TODO: should we automatically decode base64 data? Probably not...
|
||||
return [[self NSString:json] dataUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
+ (NSURL *)NSURL:(id)json
|
||||
{
|
||||
if (![json isKindOfClass:[NSString class]]) {
|
||||
|
||||
Reference in New Issue
Block a user