Anybody knows how you can still accept content-type text/plain after installing content negotiation with jackson?
Right now I have
Copy code
install(ContentNegotiation) {
jackson {
}
}
but then I get unsupported media type when posting with text/plain. Would like to support both of these formats as default
…my google wizardry is starting to drain 😞
t
tKw
01/02/2019, 11:29 AM
You may need to define a separate route to handle plain text. I am on mobile and have not been able mess with it.
o
orangy
01/02/2019, 11:33 AM
Do you mean treat plain text as json?
t
tKw
01/02/2019, 11:40 AM
I think he wants to be able to handle either content type.
o
orangy
01/02/2019, 12:43 PM
ContentNegotiation
only kicks in when you receive a custom class from the call, like
call.receive<Person>()
, so if you wish to receive a data type from the call when content-type is set to
text/plain
and treat is a JSON, you need to register JSON converter (see how