https://kotlinlang.org logo
#ktor
Title
# ktor
r

Ryan Rolnicki

05/13/2021, 2:18 AM
Hey all! Looking at docs for io.ktor.request, it doesn't give a mechanism to retrieve the 'content-length' header. I could presumably look it up with the
header()
function, but since many of the other standard headers have accessors already, it makes me wonder if it's something I shouldn't be using?
a

Aleksei Tirman [JB]

05/13/2021, 8:46 AM
There is no helper function for accessing the
Content-Length
header so it's ok to use the general way:
request.header(HttpHeaders.ContentLength)
r

Ryan Rolnicki

05/13/2021, 12:06 PM
Thanks, maybe I'll see if I can get a PR in to add it, then I update my resume with "significant contributor to the illustrious ktor framework" 😄