We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
我没有使用过 ObjectiveResource。 ASIHTTPRequest 相当容易使用。您可能需要多部分/表单数据请求,因此有一个 ASIFormDataRequest 子类。
不过,我在使用 ASIFormDataRequest 和 Rails 时遇到了一些问题。据我所知,请求中的图像附有“charset=some-encoding”参数(并且它是硬编码的),因此当 charset=utf8 存在时,Rails 不会接受它作为有效图像。另一个问题是,您的 POST 请求中不能包含数组(如 array_item[])。您根本无法添加多个具有相同名称的参数。但如果你真的想使用 ASI 框架,这两个问题都很容易解决。
看看 http://allseeing-i.com/ASIHTTPRequest/How-to-使用并在ASIFormDataRequest.h中的注释处
I haven't used ObjectiveResource. ASIHTTPRequest is fairly easy to use. You'll probably need multipart/form-data request, so there is a ASIFormDataRequest subclass for that.
I had some problems with ASIFormDataRequest and Rails though. From what I remember, images in request were accompanied by "charset=some-encoding" parameter (and it was hardcoded), so Rails wouldn't accept it as a valid image when charset=utf8 was there. Another problem was, you couldn't have arrays (like array_item[]) in your POST requests. You simply couldn't add more than one parameter with the same name. But both problems are pretty easy to patch if you really want to use ASI framework.
Take a look at http://allseeing-i.com/ASIHTTPRequest/How-to-use and at the comments in ASIFormDataRequest.h