Exposing python api over the network for an iphone application
I have functionality built in python on a central server. I wish to expose this api over the network to an iphone application. What would be the best way to do that?
Is it possible to create web services in python and have the iphone app use those? If so could anyone give me pointers as to how to create web services in python.
If someone开发者_开发问答 has a better idea on how to go about doing this let me know =)
Simplest is xmlrpclib, if the app you want to consume this service can speak XML-RPC.
According to this SO question, the iPhone can indeed support XML-RPC without too much trouble.
Look at using a REST style web service for that. I am currently working on an iPhone app that uses a Pylons based web service that the app uses to fetch JSON encoded data. So far it works like a charm.
I'm not sure what library or framework you are using, but here is a little information on Pylons REST controllers. http://pylonshq.com/docs/en/0.9.7/controllers/#using-the-rest-controller-with-a-restful-api
精彩评论