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

coder82

05/23/2019, 1:25 PM
I wanted to creat an httpClient which gets png images bur when I set the content type it throws: Header Content-Type is controlled by the engine, any idea?
s

spand

05/23/2019, 1:28 PM
Why do you want to set the content type of the request body if you want to
GET
an image ?
c

coder82

05/23/2019, 1:29 PM
indeed I need to set the accept one right?
s

spand

05/23/2019, 1:30 PM
I dont think so. Pretty sure most servers will send you without an accept header.
e

e5l

05/23/2019, 1:51 PM
Hi @coder82, you can set
ContentType
for outgoing content. Consider using
Accept
header for your requests: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
13 Views