首页 > 解决方案 > 如何从邮递员scala spray中调用实体(as [String])

问题描述

我是scala和spray的新手。我正在尝试从 Postman 打 POST api。从前端它正在工作,但我怎么能从邮递员那里打。

POST /api/admin/users/:userId/update-role
path("update-role") {
                  postCsrf {
                    entity(as[String]) { role => ctx =>
                      // TODO: This is not the optimal way to do this, but with the 2.4 time crunch, it's going in as tech debt.
                      }
                } ~

邮递员的要求

来自前端的请求

标签: scalapostmanspray

解决方案


推荐阅读