How to make the client a spray client follow forwarding

When requesting some pages with the following code:

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

the spray client returns redirected responses to other URLs (for example, 302 Found). Is there a standard way of informing a spray to automatically follow a redirect? And if not, what is the best way to implement this behavior with aka futures?

+4
source share
1 answer

Update 2: PR has been merged, and the documentation for redirection, the next one, is now available from the spray can here

Update: I decided that I have a crack in implementing this and sent a PR . Hope it will be combined.


There is currently no way to tell the client a spray client the possibility of 3xx forwarding. See this thread for more details.

There is an open open ticket , so hopefully this will happen in the future. I am sure that this contribution would be welcome.

+1
source

Source: https://habr.com/ru/post/1447461/


All Articles