2
Completed

Automatically follow redirects on HTTP Requests

Tasker should have an option to automatically follow redirects on the HTTP Request action.  If the response is a 301 (permanent redirect) or 307 (temporary redirect) then the new URL is in the response location header.  It would be great if tasker had an option to automatically make the same request again at the URL specified in the location header when it receives a redirect response like this.

Note that it should also log that this happened so the developer can see it.  And if it is a permanent redirect then it would be nice if tasker somehow called your attention to that, perhaps by marking the log event with an icon or something.  Since developers should change their code for a permanent redirect and stop calling the old URL.

Note: Upon further testing, it seems Tasker does automatically follow redirects for GET requests it just doesn't for other methods.  So I guess I need to get more specific.  It would be great if Tasker had a user configurable option to follow redirects for all methods.  And when it does so, it needs to pass along the headers and body of the original request as well.

2 replies

I have now implemented this :)

Can you please try this version? https://drive.google.com/file/d/1UfMEt1H6wjlMDdsqByn-flCRqE45PdJ1/view?usp=sharing

Thanks Michael! Would it be possible to share some URLs where this stuff is happening so I can test it out?

Well actually I did and you replied to it haha: https://tasker.helprace.com/i650-http-request-not-working-and-not-clear-why

I was trying to make calls to the Nest API and was confused why I was getting failures but turned out it was actually trying to redirect me to a firebase endpoint.  That's the only example I know of which is doing that though

I'm also getting 301 when trying to use HTTP request to make a GET request to http://www.reddit.com/r/EarthPorn/hot/.rss