开发者

iPhone photo app communication with Rails server

开发者 https://www.devze.com 2023-03-19 05:45 出处:网络
I am building an 开发者_JAVA技巧iPhone app which uploads/downloads photos to a Rails server. How should I transfer my photos to/from the Rails server to iPhone? Should I use JSON? My Rails app support

I am building an 开发者_JAVA技巧iPhone app which uploads/downloads photos to a Rails server. How should I transfer my photos to/from the Rails server to iPhone? Should I use JSON? My Rails app supports a RESTful architecture. Any pointers to examples would help.


I recently did something similar, and would suggest using ASIHTTP on the iPhone side, communicating with your Rails app.

Here is how to use ASIHTTP: http://allseeing-i.com/ASIHTTPRequest/How-to-use

Pay special attention to the section "Sending a form POST with ASIFormDataRequest"

You can attach photos (or any file, really) simply by saying

[request setFile:@"photo.jpg" forKey:@"photo"]

Then you can access/manipulate it on the Rails side through your params

0

精彩评论

暂无评论...
验证码 换一张
取 消