I have below key pair to be pass in my JSON input working fine with Postman REST client extension but on hitting with iOS webservice it gives "error parameter missing".
msg={
"Data": {
"ID": "1",
"password": "password123",
"type": "good",
"name": "testuser"
},
"apicode": "1234",
"key": "12133"
}
Here is my JSON dictionary I have created, please check any error in it ?
NSError *error;
NSDictionary * Datadic = [NSDictionary dictionaryWithObjectsAndKeys:
ID, @"ID",
password, @"password",
type, @"type",
name, @"name",
nil];
NSDictionary *json_Dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
Datadic, @"Data",
apicode, @"apicode",
key, @"key",
nil];
NSDictionary *jsonmsgDDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
json_Dictionary, @"msg",
nil];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject: jsonmsgDDictionary options:NSJSONWritingPrettyPrinted error:&error];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"jsonData as string:\n%@", jsonString);
On creating URL using above jsonstring
NSString *urlstring=[NSString stringWithFormat:@"http://%@:%@/signUp?msg-%@",self.input_hostaddress,self.input_portNo,jsonstring];
Then
NSURL *url = [NSURL URLWithString:urlstring];
/// this line url = nil why ?