Domanda

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

È stato utile?

Soluzione 2

I found the answer by myself:

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

Altri suggerimenti

In current version of unfiltered just respond with following code:

Ok ~> ResponseHeader("Content-Type", Set("application/json"))
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top