I have a function which invokes an azure REST API.
- (void)authenticateUser:(NSString*)usernameString
passwordString: (NSString*)passwordString{
self.client = [MSClient clientWithApplicationURLString:@"url" applicationKey:@"url"];
[self.client invokeAPI:@"AuthenticateAndFetchData"
body:nil
HTTPMethod:@"GET"
parameters:@{ @"userid": usernameString, @"password" : passwordString }
headers:nil
completion: ^(NSData *result, NSHTTPURLResponse *response, NSError *error) {
if(error) {
NSLog(@"ERROR %@", error);
} else {
NSLog(@"%@", result);
}
}];
}
This code is inside a function. I want the JSON object received in the result
object to be returned as an NSData so that I can use this object in other classes and parse the data. Can anyone help me with this?