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
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
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
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
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