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 December 2014 at 15:25:21, Jo Kade (jks...@karchedon.de) wrote:

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 RawHeader("Content-Type","text/html") results in an error. Thanks,

Best regards,

Johannes

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to