Batch HTTP requests in Play!Framework

后端 未结 2 929
时光取名叫无心
时光取名叫无心 2021-01-16 07:51

I have the current set of of routes implemented (for example):

GET     /api/:version/:entity               my.controllers.~~~~~
GET     /api/:version/:entity         


        
相关标签:
2条回答
  • 2021-01-16 08:41

    You can probably use WS API for that, but personally I'd just create a private methods for collecting data and use them from both - 'single' and also 'batch' actions - it will be faster for sure.

    0 讨论(0)
  • 2021-01-16 08:46

    You can use the following method call to route your fake requests: Play.current.global.onRouteRequest. Please see this post for a full example: http://yefremov.net/blog/play-batch-api/

    0 讨论(0)
提交回复
热议问题