简体   繁体   English

在代码中集成Web服务的最佳方法

[英]Best way to integrate web-services in iOS in code

previously i call the service from the same class when and where i need the data. 以前,我在需要数据的时间和地点从同一个类中调用该服务。 is it a good approach to do it, let me know the best option to integrate web-services. 这是一个好方法吗,请让我知道集成Web服务的最佳选择。 Also using ASIHttpRequest framework is come under good coding standards? 还使用ASIHttpRequest框架是否符合良好的编码标准?

yes ,ASIHttpRequest framework is come under good coding standards. 是的,ASIHttpRequest框架符合良好的编码标准。 there are some features that missing in AFNetwork.You can check below link AFNetwork中缺少一些功能。您可以在下面的链接中查看

What major ASIHTTPRequest features is AFNetworking missing? AFNetworking缺少哪些主要的ASIHTTPRequest功能?

是的,我同意ASIHttpRequest框架是很好的,大多数人都喜欢它,但是它没有得到维护,因此我们还需要寻找其他选择。我使用AFNetworking而不是ASIHttpRequest,发现它的性能比ASIHttpRequest更快,它已经在使用NSSerialization用于解析JSON字符串,因此您不必担心JSON解析。当我们调用api时,它们会处理我们需要的所有内容,例如JSON解析,XML解析,加载程序等。您可以检查http://www.absoluteripple.com /1/post/2013/01/using-afnetworking.html https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM