简体   繁体   中英

How to make spray-can client follow redirects

When requesting some pages with the following code:

HttpDialog(httpClient, IDN.toASCII(domain)).send(HttpRequest(uri = "/")).end

spray-can client returns responses with redirects to another URLs (eg 302 Found). Is there a standard way of telling spray to automatically follow redirects? And if not, what is the best way to implement this behavior myself with akka futures?

Update 2: The PR was merged and documentation for redirection following is spray-can can now be found here

Update: I decided to have a crack at implementing this and have sent a PR . Hopefully it will get merged.


There is no way to currently tell spray-can client to follow 3xx redirects. See this thread for more details.

There is an open ticket , so hopefully this will happen in the future. I'm sure a contribution would be welcomed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM