ASIHttpRequest调用Restful Web服务? [英] ASIHttpRequest call Restful web service?

查看:128
本文介绍了ASIHttpRequest调用Restful Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASIHttpRequest可以调用Restful Web服务吗?我知道Restkit很擅长. 如果没有,有任何简单的转换方法吗?

Can ASIHttpRequest call Restful web service ? I knew that Restkit is good at it. If no,any easy way to convert ?

我们可以说ASIHttpRequest擅长调用基于soap的Web服务吗?

Can we say that ASIHttpRequest is good at calling soap based web service ?

感谢您的评论!

推荐答案

ASIHTTPRequest仅执行HTTP请求.仅此而已.由于REST也是HTTP请求,因此您可以将ASIHTTPRequest与宁静的Web服务配合使用.但是,它不会对响应进行任何解析,因此,如果响应为JSON,您仍然必须自己解析该响应.

ASIHTTPRequest simply does a HTTP request. Nothing more, nothing less. Since REST is also just an HTTP request, you can use ASIHTTPRequest just fine with a restful web service. It doesn't do any parsing of the response, though, so if the response is JSON you still have to parse that yourself.

您还可以将ASIHTTPRequest用于SOAP,但是您必须自己构造XML(或使用其他库),并且还必须自己解析XML响应.对于SOAP,您可能想使用 http://sudzc.com/.

You can also use ASIHTTPRequest for SOAP but you have to construct the XML by yourself (or using some other library) and parse the XML response by yourself as well. For SOAP you may want to use http://sudzc.com/ instead.

这篇关于ASIHttpRequest调用Restful Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆