我正在考虑用类似这样的东西替换 POST 中 JSON 中名为“type”的字段
def rawJson = extract { _.request.entity.asString}
post {
rawJson { json =>
val new json = println(json.replace("\"type\":", "\"eventType\":"))}
}
现在,有了这个新的 JSON,我想重新注入 POST 以将其视为新调用。我知道“重定向”,但在这种情况下我看不到使用它的方法。
谢谢!