【发布时间】:2014-01-14 16:22:54
【问题描述】:
在喷雾中,我想根据给定的Accept 标头来响应不同的内容类型。我在question by rompetroll 中看到了一些建议,但我想知道是否有任何规范的方法(即简单或已经实现)。
本质上我想应该发生的事情是这样的:
path("somepath") {
get {
// Find whatever we would like to return (lazily)
...
// Marshall resource and complete depending on the `Accept` header
...
}
}
提前致谢。
【问题讨论】:
标签: scala routing http-headers spray http-accept-header