Chromium Code Reviews| Index: sdk/lib/io/http.dart |
| diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart |
| index 755c96ccf7d04b1e3f46fe4bffd1b3c0184fce6a..f5ee40df9b4e108cfd5e58426a2282eb50960242 100644 |
| --- a/sdk/lib/io/http.dart |
| +++ b/sdk/lib/io/http.dart |
| @@ -845,6 +845,27 @@ abstract class HttpResponse implements IOSink { |
| List<Cookie> get cookies; |
| /** |
| + * Send a redirect to [location] to the client. |
|
Anders Johnsen
2013/08/02 08:22:03
"to the client." may be redundant.
Søren Gjesse
2013/08/02 09:01:06
Done.
|
| + * |
| + * The [location] argument can be either a [Uri] or a [String]. If |
| + * it is a [String] it is turned into a [Uri] using [Uri.parse]. |
| + * |
| + * The redirect response will always have an absolute URI in the |
| + * `Location` header. If the URI passed in [location] is relative it |
| + * will be turned into an absolute URI by resolving it against the |
| + * URI of the current request and the address and port of the |
| + * server. |
| + * |
| + * By default the HTTP status code `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(location, [int status = HttpStatus.MOVED_TEMPORARILY]); |
|
Anders Johnsen
2013/08/02 08:22:03
I think it should be a named argument.
Søren Gjesse
2013/08/02 09:01:06
Done.
|
| + |
| + /** |
| * Detaches the underlying socket from the HTTP server. When the |
| * socket is detached the HTTP server will no longer perform any |
| * operations on it. |