crayon icon indicating copy to clipboard operation
crayon copied to clipboard

HTTP library: Add an option to follow redirects

Open blakeohare opened this issue 8 years ago • 1 comments

The following status codes...

MOVED_PERMANENTLY = 301, MOVED_TEMPORARILY = 302, SEE_OTHER = 303, (maybe) TEMPORARY_REDIRECT = 307, PERMANENT_REDIRECT = 308,

...should automatically redirect the request if the user enables that via an option like...

request = new HttpRequest(url)
  .enableRedirects()
  .sendAsync();

Also remember to note the differences in changing POST to GET between 301/302 and 307/308

blakeohare avatar Aug 14 '16 19:08 blakeohare

There's actually a more important bug here: some platforms' underlying HTTP implementation already do this by default and some do not.

blakeohare avatar Mar 19 '19 20:03 blakeohare