I am getting "Request body length does not match c...
# ktor
a
I am getting "Request body length does not match content-length header" when i do a simple .get() request using ktor on nodejs to github (https://api.github.com/repos/composablehorizons/compose-unstyled) I do not understand if this is ktor, or node or github related. anyone got any clues? (i know it's too broad, but no luck with my searching)
Yeah this is ktor. Did it using node fetch and it worked:
Copy code
val jsResponse = fetch("<https://api.github.com/repos/composablehorizons/compose-unstyled>")
t
Do you have any plugin installed on Ktor?
a
no. I just use
Copy code
val httpClient = HttpClient()
t
Interesting. I was able to reproduce this error only by having the server not send the full response. Headers would say the length is
1000
but would send
900
and close. Could it be an issue from Github 🤷‍♂️ When we open the link in the browser, we receive a GZIP response. I think that
fetch
handles this without having to think about it. But maybe with Ktor you need to add a plugin for it.
a
I cannot reproduce the problem. Which platform do you target, JS or Wasm/JS?
a
js. nodejs