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

pavel

02/10/2020, 9:47 PM
That error would typically be coming from the server you are calling. It is completely within it’s rights to return a 411 response
1
r

Rui

02/10/2020, 10:14 PM
But when I make postman request it works fine. So I assume it's sth related to Ktor, not some issue with the server I'm calling,
r

Rui

02/10/2020, 10:36 PM
Yeah I read that. So I tried adding Content-Length: 0 to my header, then it returned message saying I shouldn't manually set the length. If I don't add it to header it returned 411. The only way to make it work is to add something to the body. Below is my code:
Untitled.txt
p

pavel

02/10/2020, 10:43 PM
You could try switching to okhttp
r

Rui

02/10/2020, 10:50 PM
Great now it works! Thanks for your help! Should the team record it as a bug for future fix?
p

pavel

02/10/2020, 10:51 PM
It already is
3 Views