I have a problem with my JSON-RPC query.
NSString *jsonString = @"{id:1,method:getHolidays,jsonrpc:2.0}";
NSString *requestString = [NSString stringWithFormat:@"%@",jsonString,nil];
NSData *requestData = [NSData dataWithBytes: [jsonString UTF8String] length: [requestString length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:@"https://neilo.webuntis.com/WebUntis/jsonrpc.do?school=htl_v%C3%B6cklabruck"]];
[request setHTTPMethod: @"POST"];
[request setValue:@"Content-type: application/json" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:requestData];
NSData *returnData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil ];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding: NSUTF8StringEncoding];
NSLog(@"\n\n\noutput: %@",returnString);
As Result I get this output:
{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error: Unexpected character ('i' (code 105)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@7a1efafd; line: 1, column: 3]"}}
The Result should be:
->message = not-authenticated
<-
Does anyone have any idea what the problem is?