Guys I have a used case like getting csrf token fr...
# multiplatform
h
Guys I have a used case like getting csrf token from my backend service on post auth call, which is a prerequisite for all my further requests, can i get a help how to achieve this in Ktor as I dont see such used cases mentioned in documentation, bcz my backend service returns 302 with redirection exception, i don't care about exception but what i need is csrf token received from response
a
I am not sure if Ktor support a redirect for POST requests. But you can try:
Copy code
install(HttpRedirect) {
            checkHttpMethod = false
        }
in your HttpClient init
h
Thanks for the reply Anton I got the solution, we can enable cookies through
Copy code
HttpClient {
    install(HttpCookies) {
        storage = AcceptAllCookiesStorage()
    }