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:
Mike Driver
2015-04-09 20:18:31 -07:00
parent 7f9ee949ee
commit b1850f8fca
4 changed files with 33 additions and 24 deletions

View File

@@ -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;

View File

@@ -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]]) {