문제

I response a stream, and I want add headerName fileName to response's header. But I don't wirte?

req.respond(CharContentType("text/csv") ~> ResponseBytes(xxxxx.usersExport))

I know a Header.scala https://github.com/unfiltered/unfiltered/blob/master/library/src/main/scala/response/headers.scala

도움이 되었습니까?

해결책 2

I found the answer by myself:

req.respond(new ResponseHeader("key","value") ~> CharContentType("text/csv") ~> ResponseBytes(xxxxx.usersExport))

다른 팁

In current version of unfiltered just respond with following code:

Ok ~> ResponseHeader("Content-Type", Set("application/json"))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top