为了获得 JSON,我使用了这个答案SBJsonWriter Nested NSDictionary
{"key1":"bla1","key2":{"a":"a1","b":"b1","c":"c1","d":"d1"},"key3":"bla3"}
现在我有一个我已经调用的刺痛,theString
我需要将它添加到一个 urlhttp://mysyte.net:8888/JSON?
并接收这样的东西http://lcwebtest.sytes.net:8888/JSON?{"key1":"bla1","key2":{"a":"a1","b":"b1","c":"c1","d":"d1"},"key3":"bla3"}
这是我所做的:
NSString *urlString = [NSString stringWithFormat:@"http://mysyte.net:8888/JSON?%@",theString];
NSLog 给出http://mysyte.net:8888/JSON?{"key2":{"d":"d1","b":"b1","c":"c1","a":"a1"},"key1":"bla1","key3":"bla3"}
然后我通过 NSURL *url1 = [NSURL URLWithString:urlString];
但是NSLog(@"%@",url1);
给了我{null}
我假设 NSURL 不想读取“{”或“}”,并认为 url 格式错误。
如何接收 URL 以发出 GET 请求?