Re: [akka-user] akka-http / routing DSL: How to set response content type?

2014-12-12 Thread André
Hi Jo, as Björn and Mathias exlained there's no need to set the Content-Type explicitly. Just import ScalaXmlSupport and complete with a NodeSeq (example https://github.com/akka/akka/blob/release-2.3-dev/akka-http-tests/src/test/scala/akka/http/server/TestServer.scala) or alternatively

Re: [akka-user] akka-http / routing DSL: How to set response content type?

2014-12-11 Thread Björn Antonsson
Hi Johannes, It seems like there is a mismatch here. The only way that I can find is to use the Java API like this respondWithHeaders(akka.http.model.japi.headers.ContentType.create(ContentType(`text/html`))) I've opened a ticket here https://github.com/akka/akka/issues/16523 B/ On 10

Re: [akka-user] akka-http / routing DSL: How to set response content type?

2014-12-11 Thread Björn Antonsson
Hi again Johannes, Mathias was kind enough to educate me in the ticket that the respondWithMediaType way of doing things has been removed since it was considered an antipattern and you should now use the Marshalling infrastrucutre instead to acheive the same results. Please take a look at

Re: [akka-user] akka-http / routing DSL: How to set response content type?

2014-12-11 Thread Jo Kade
Hi Björn, thanks for the reply; however, although this solution compiles, I get a runtime warning: Explicitly set HTTP header 'Content-Type: text/html' is ignored, explicit `Content-Type` header is not allowed. Set `HttpResponse.entity.contentType` instead. -- Johannes On Thursday, December

[akka-user] akka-http / routing DSL: How to set response content type?

2014-12-10 Thread Jo Kade
What is the intended way to set the response content type from within a route? In spray there is a respondWithMediaType() directive, but akka-http has not (yet?). I cannot use respondeWithHeader(`Content-Type`()) since it has a package-private constructor, and using