The PartialContent plugin adds support for handling HTTP range requests used to send only a portion of an HTTP message back to a client. This plugin is useful for streaming content or resuming partial downloads.
PartialContent has the following limitations:
Works only for
GETrequests and returns
405 Method Not Allowedif the client tries to use the
Rangeheader with other methods.
Works only for responses that have the
Disables Compression when serving ranges.
PartialContent, you need to include the
ktor-server-partial-content artifact in the build script:
To install the
PartialContent plugin, pass it to the
install function in the application initialization code. Depending on the way used to create a server, this can be the
embeddedServer function call ...
... or a specified module.
To learn how to use
PartialContent to serve a file using HTTP range requests, see the File section.