scala - 如何从邮递员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.
}
} ~
解决方案
推荐阅读
- android - Android发布者API取消订阅后无法恢复订阅
- node.js - 如何限制 Firestore 查询中的集合数量?
- scala - 如何从 Gatling 中的响应正文中提取 JSON
- python - 正则表达式,查找特定行,从该行查找特定单词
- python - GCP App Engine 部署 - 无法构建 logilab-astng
- c# - 在 VS 2017 的预构建事件中使用 protoc 从 .proto 文件生成 c# 文件
- github-actions - Github Actions 是否可用于分叉存储库?
- macos - macCatalyst 项目的最小 macOS 部署目标?
- python-3.x - 从 Python 写入 Jupyter Notebook
- java - 尝试将重复记录插入数据库时出现 sql 异常