Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: sdk/lib/io/http.dart

Issue 21411003: Add redirect method to HttpResponse (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http.dart
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index 755c96ccf7d04b1e3f46fe4bffd1b3c0184fce6a..4b490c215e38af660cf1f716f77513fb077dd059 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -845,6 +845,21 @@ abstract class HttpResponse implements IOSink {
List<Cookie> get cookies;
/**
+ * Respond with a redirect to [location].
+ *
+ * The URI in [location] should be absolute, but there are no checks
+ * to enforce that.
+ *
+ * By default the HTTP status code `HttpStatus.MOVED_TEMPORARILY`
+ * (`302`) is used for the redirect, but an alternative one can be
+ * specified using the [status] argument.
+ *
+ * This method will also call `close`, and the returned future is
+ * the furure returned by `close`.
+ */
+ Future redirect(Uri location, {int status: HttpStatus.MOVED_TEMPORARILY});
+
+ /**
* Detaches the underlying socket from the HTTP server. When the
* socket is detached the HTTP server will no longer perform any
* operations on it.
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698