| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * HTTP status codes. | 8 * HTTP status codes. |
| 9 */ | 9 */ |
| 10 abstract class HttpStatus { | 10 abstract class HttpStatus { |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 * Returns the response headers. | 838 * Returns the response headers. |
| 839 */ | 839 */ |
| 840 HttpHeaders get headers; | 840 HttpHeaders get headers; |
| 841 | 841 |
| 842 /** | 842 /** |
| 843 * Cookies to set in the client (in the 'set-cookie' header). | 843 * Cookies to set in the client (in the 'set-cookie' header). |
| 844 */ | 844 */ |
| 845 List<Cookie> get cookies; | 845 List<Cookie> get cookies; |
| 846 | 846 |
| 847 /** | 847 /** |
| 848 * Respond with a redirect to [location]. |
| 849 * |
| 850 * The URI in [location] should be absolute, but there are no checks |
| 851 * to enforce that. |
| 852 * |
| 853 * By default the HTTP status code `HttpStatus.MOVED_TEMPORARILY` |
| 854 * (`302`) is used for the redirect, but an alternative one can be |
| 855 * specified using the [status] argument. |
| 856 * |
| 857 * This method will also call `close`, and the returned future is |
| 858 * the furure returned by `close`. |
| 859 */ |
| 860 Future redirect(Uri location, {int status: HttpStatus.MOVED_TEMPORARILY}); |
| 861 |
| 862 /** |
| 848 * Detaches the underlying socket from the HTTP server. When the | 863 * Detaches the underlying socket from the HTTP server. When the |
| 849 * socket is detached the HTTP server will no longer perform any | 864 * socket is detached the HTTP server will no longer perform any |
| 850 * operations on it. | 865 * operations on it. |
| 851 * | 866 * |
| 852 * This is normally used when a HTTP upgrade request is received | 867 * This is normally used when a HTTP upgrade request is received |
| 853 * and the communication should continue with a different protocol. | 868 * and the communication should continue with a different protocol. |
| 854 */ | 869 */ |
| 855 Future<Socket> detachSocket(); | 870 Future<Socket> detachSocket(); |
| 856 | 871 |
| 857 /** | 872 /** |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1483 |
| 1469 class RedirectException implements HttpException { | 1484 class RedirectException implements HttpException { |
| 1470 final String message; | 1485 final String message; |
| 1471 final List<RedirectInfo> redirects; | 1486 final List<RedirectInfo> redirects; |
| 1472 | 1487 |
| 1473 const RedirectException(String this.message, | 1488 const RedirectException(String this.message, |
| 1474 List<RedirectInfo> this.redirects); | 1489 List<RedirectInfo> this.redirects); |
| 1475 | 1490 |
| 1476 String toString() => "RedirectException: $message"; | 1491 String toString() => "RedirectException: $message"; |
| 1477 } | 1492 } |
| OLD | NEW |