Zoltan Demant
09/26/2023, 1:42 PMUnhandled redirect: DELETE <https://foo.bar>. Status: 301 Moved Permanently. Text: ""
for certain requests. Yet, the URL:s work perfectly fine when using curl in the command line. Why could that be?Casey Brooks
09/26/2023, 1:51 PMZoltan Demant
09/26/2023, 2:21 PMfollowRedirects = true
(forgot to press send earlier 😅).Casey Brooks
09/26/2023, 2:30 PMLocation
header with the URL to redirect to. It’s commonly used to upgrade an HTTP connection to HTTPS, for example. https://en.wikipedia.org/wiki/HTTP_301
Also, by default it looks like the Ktor client only handles redirection for GET requests, while you’re is a DELETE. You might try configuring it to set this property to false so it also works for DELETEZoltan Demant
09/26/2023, 3:42 PMCasey Brooks
09/26/2023, 3:44 PMZoltan Demant
09/27/2023, 3:42 AMPlease note: changing this flag could lead to security issues, consider changing the request URL instead.I dont believe this is possible for me to do, given that theyre identical on the surface? Also, never thought about the server adding cookies/headers like that - but makes sense, Ill check with the API owners about this.
/
at the end of the URL makes a world of a difference! I cant believe I missed that, looking through my logs I can see that the redirect URL actually has the added slash, I just didnt notice it .. for 5 hours yesterday ❤️ Everything works now.Casey Brooks
09/27/2023, 2:12 PM