我正在努力获得api时,在应用程序中的api我没有得到更新的响应当我从模拟器和设备中删除应用程序它的工作fine.guys我做错了请帮助我。我已经尝试了Afnetworking简单的Api nsurl会话。获取Api不能正常工作
NSString *strURL = [NSString stringWithFormat:@"https://mysponsers.com/m/comments/publicpost/674"];
NSURL *url = [NSURL URLWithString:strURL];
AFHTTPClient *httpClient = [[AFHTTPClient alloc]initWithBaseURL:url];
[httpClient getPath:strURL parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
id json = [NSJSONSerialization JSONObjectWithData:responseObject options:kNilOptions error:nil];
NSLog(@"RESPONSE--->1%@",json);
} failure:^(AFHTTPRequestOperation* operation, NSError *error) {
//fail!
NSLog(@"Error String is %@", error.localizedDescription);
}];
这里是我使用afnetworkikng击打api的代码。
谢谢
dont tag swift for objC questions –
发生了什么事? – shallowThought
您正在使用哪种版本的AFNetworking? –