Hi guys, whenever I use `HttpRequestBuilder` and t...
# ktor
r
Hi guys, whenever I use
HttpRequestBuilder
and try to specify
ContentType(ContentType.Application.Json)
I get
Header Content-Type is controlled by the engine and cannot be set explicitly
. I’ve tried adding
defaultRequest { ContentType }
into the
HttpClient {  }
but I still get the same error. How would I go about setting the content type?
e
Hi @rodrigo, what version of ktor do you use?
r
@e5l version
1.1.3
e
You could specify
ContentType
in request
body
using OutgongContent subtype.
Also, you could use
JsonFeature
and it does it for you.
r
cool I will try, thank you!