curl -X GET
--header "Accept: application/json"
--header "app_id: 999999"
--header "app_key: xxxxxxx"
--header "Dev-Mode: true" "https://api.infermedica.com/v2/symptoms"
Objective-C-Code
(void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//CURL
//curl -X GET --header "Accept: application/json" --header "app_id: 795edb00" --header "app_key: c68cb95e54ec04f44544bb5fd7ab5125" --header "ev-Mode: true" "https://api.infermedica.com/v2/symptoms"
NSString *str = [NSString stringWithFormat:@"https://api.infermedica.com/v2/symptoms;app_id=795edb00;app_key=c68cb95e54ec04f44544bb5fd7ab5125"];
NSURL *url = [[NSURL alloc]initWithString:str];
NSData *data = [[NSData alloc ]initWithContentsOfURL:url];
arr = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
NSLog(@"%@",arr);
Was haben Sie versucht? Wie versuchst du, curl im Ziel-c-Code zu ersetzen? Benutzt du eine Bibliothek? Weißt du was -i und -u tun? Was hast du versucht, ihre Anrufungen zu ersetzen? Ihrer Frage fehlen alle diese Informationen. –
Mögliches Duplikat von [Konvertieren eines CURL-Befehls für Objective C] (http://stackoverflow.com/questions/8982707/converting-a-curl-command-for-objective-c) –