ios - Json 代码不起作用
<p><pre><code>NSString *urlString = @"http://chkdin.com/dev/api/peoplearoundmexy/?";
NSURL *url = ;
NSMutableURLRequest *request = [ init];
NSString *parameterString=;
NSLog(@"%@",parameterString);
;
;
;
;
NSData *postData = ;
;
NSData *data = ;
NSLog(@"%@",);
NSDictionary *dict = ;
NSLog(@"%@",dict);
</code></pre>
<p>这是我的 json 解析,我的问题是当我点击这个 api 时它正在显示</p>
<pre><code>{
message = "Valid skey required.";
status = 0;
}
</code></pre>
<p>但是这个 api 在 safari 中工作。我认为问题是请求添加到 url 错误。你能帮我吗....</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我通过 AFNetworking 3 得到响应</p>
<p>试试这个</p>
<pre><code> AFHTTPSessionManager *manager = ;
manager.responseSerializer = ;
[manager GET:@"http://chkdin.com/dev/api/peoplearoundmexy/?" parameters:@{@"skey":@"sa6rw9er7twefc9a7dvcxcheckedin",@"user_id":@"3225"} progress:nil success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"%@",responseObject);
} failure:^(NSURLSessionTask *operation, NSError *error) {
}];
</code></pre>
<p> <a href="/image/UFSKM.png" rel="noreferrer noopener nofollow"><img src="/image/UFSKM.png" alt="enter image description here"/></a> </p></p>
<p style="font-size: 20px;">关于ios - Json 代码不起作用,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/40839384/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/40839384/
</a>
</p>
页:
[1]