response
Declares the response body type.
When a client makes a request to the server, the server will respond with an instance of this type.
Under the hood, this method uses Ktor's content negotiation features. Therefore, all types that would be valid with content negotiation can be used with this library. Note that you may need to perform some configuration on the Ktor side before using some types, see the official documentation for instructions.
Example
val list by post()
.request<UserCreationDto>()
.response<UserDto>()Content copied to clipboard
If this method is called multiple times, only the last call is retained.