https://kotlinlang.org logo
#http4k
Title
# http4k
m

Manas Marthi

10/03/2023, 1:02 PM
I have a GET call which can either return response code 200 and json content, or returns 302 response code with a Location header which is a file download with a content type as octet stream. How can I deal with this in a client call. I am trying to convert my java code to Kotlin code. I could not find an example which can deal with 302 response and be able to download json file
s

s4nchez

10/03/2023, 1:17 PM
You can either deal with it yourself (by inspect the status code and deciding what to do next), or you can add the
ClientFilters.FollowRedirects
filter to your client and it should do it for you.
2 Views