您好,我目前正在重新设计我们的移动应用程序。目前,我的手机应用程序正在向我的服务器发出 url 请求,该请求返回一个 json,然后该 json 被吸收并相应地使用数据。
该网站也与相同类型的数据进行交互。
我想知道如果我应该创建一个休息服务,它与仅让服务器输出 json 给出特定参数有何不同。我本来计划使用 django 来实现这一点,但想知道当 django 内置了一个 Rest 框架时,使用 django-piston 之类的东西有什么好处。
另外,创建休息服务是电话和网站交互的好方法吗?
Hi I am currently redesigning our mobile application. Currently my phone application is doing a url request to my server which is returning a json which then gets absorbed and the data is used accordingly.
The website that interacts with the same kinds of data as well.
I was wondering that if I should create a rest service what makes it different from just having the server output jsons given specific parameters. I was planning on using django to implement this but was wondering what the benefits are of using something like django-piston when django has a rest framework built into it.
Also is creating a rest service a good way for phones and websites to interact with each other?
发布评论
评论(2)
您绝对应该看看这个 Django REST 框架。
我曾经使用 tastypie...但特别是因为上传和下载文件(图像)以及可浏览 api 的便捷性,我转而使用这个:
django-rest-framework.org
我使用它与移动应用程序交互(但也使用老式的胖客户端,在我的例子中是java......)
You absolutely should have a look at this Django REST Framework.
I used to use tastypie... but especially because of the easyness of up- and downloading files (images) and the browsable api, i switched to using this one:
django-rest-framework.org
I Am using it for interacting with mobile applications (but also the old fashioned thick clients, in my case in java....)
因为如果你编写 REST,你可以这样做:
The Richardson 成熟度模型:四个 REST 度
Because if you write REST, you can do stuff like this:
The Richardson Maturity Model: Four degrees of REST