简体   繁体   English

如何向Django项目添加批处理请求处理?

[英]How to add batch requests handling to Django project?

I have an Django application that provide WEB APIs. 我有一个提供WEB API的Django应用程序。

I want to add batch requests (send multiple operations in a single HTTP request) handling to it. 我想在其中添加批处理请求(在单个HTTP请求中发送多个操作)处理。

What is the best way to do it? 最好的方法是什么?

django-batch-requests seems like a reasonable bare-bones solution. django-batch-requests似乎是一个合理的简单解决方案。 This article gives a better treatment of how batch requests should probably be done in a REST api - basically, the "POST json describing the request" approach is flawed in the same ways SOAP is - and worse, since it makes the behavior of your REST api inconsistent. 文章提供了一个更好的治疗如何一批请求应该大概在一个REST API来完成-基本上,“POST JSON描述请求”的方式在同一方式SOAP是有缺陷的是-更糟的是,因为它使你的REST的行为api不一致。

Also, Facebook defines a batch requests api if you want something to emulate. 此外,如果您想要模仿某些内容, Facebook会定义批量请求API。 They use the SOAP-ish approach. 他们使用SOAP-ish方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM