Yep, when you post something to the test applicati...
# ktor
m
Yep, when you post something to the test application engine, you now need to specify the content type
t
Is there a way to define application/json as the default content-type now or do I have to specify it every time?
m
It’s every time now.
😢 1
m
Write a helper extension function I suppose
t
Can't see an easy way to do so when test methods already use functions that require knowledge of the test engine.
m
Instead of a
setBody
, write a
setJsonBody
that calls
setBody
and
addHeader
.
t
I can do that yes, but I was more thinking of a way to have the setJsonBody be called by default.
I can't find this change listed as a breaking one, even thought it breaks every piece of code that hasn't explicitly set a content-type, which caused me some headache 😕
m
Indeed