``` The HttpRequestBuilder.body property can be a ...
# ktor
h
Copy code
The HttpRequestBuilder.body property can be a subtype of OutgoingContent as well as a String instance:

body = "HELLO WORLD!"
body = TextContent("HELLO WORLD!", ContentType.Text.Plain)
...
Got me excited that setter overrides had been added or something but
body
is just defined as
Any
. 😭
📝 1
Not that that doesn't make sense, particularly given the
JsonFeature
, but damn I was excited =P
d
I have to update the documentation
h
HttpRequestBuilder.body property can be a subtype of OutgoingContent as well as a String
made me think that setter overloads had been added: https://youtrack.jetbrains.com/issue/KT-4075
d
Nope. I meant that it was
Any
but you can set those instances. I guess that right now you have to use methods.
setBody(content: TextContent)
+
setBody(content: String)
or so.