Hey guys, I used `@Body` in retrofit. what is alte...
# ktor
v
Hey guys, I used
@Body
in retrofit. what is alternative in ktor?
m
Did you tried retrieving it in the routing handler ? You can use the ContentNegotiation plugin to deserialize the payload to any class definition. https://ktor.io/docs/requests.html#body_contents
v
I need in ktor client
your provide link is for body contents in ktor server
I am not using routing
m
ok, so you need to pass the payload as body when creating the request. This is an example:
Copy code
client.get("/") {
                    setBody(Objects)
     }
sorry for the formatting
v
great thanks a million
👍 1