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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 * | 743 * |
744 * application/octet-stream | 744 * application/octet-stream |
745 */ | 745 */ |
746 static final BINARY = new ContentType("application", "octet-stream"); | 746 static final BINARY = new ContentType("application", "octet-stream"); |
747 | 747 |
748 /** | 748 /** |
749 * Creates a new content type object setting the primary type and | 749 * Creates a new content type object setting the primary type and |
750 * sub type. The charset and additional parameters can also be set | 750 * sub type. The charset and additional parameters can also be set |
751 * using [charset] and [parameters]. If charset is passed and | 751 * using [charset] and [parameters]. If charset is passed and |
752 * [parameters] contains charset as well the passed [charset] will | 752 * [parameters] contains charset as well the passed [charset] will |
753 * override the value in parameters. Keys and values passed in | 753 * override the value in parameters. Keys passed in parameters will be |
754 * parameters will be converted to lower case. | 754 * converted to lower case. The `charset` entry, whether passed as `charset` |
| 755 * or in `parameters`, will have its value converted to lower-case. |
755 */ | 756 */ |
756 factory ContentType(String primaryType, | 757 factory ContentType(String primaryType, |
757 String subType, | 758 String subType, |
758 {String charset, Map<String, String> parameters}) { | 759 {String charset, Map<String, String> parameters}) { |
759 return new _ContentType(primaryType, subType, charset, parameters); | 760 return new _ContentType(primaryType, subType, charset, parameters); |
760 } | 761 } |
761 | 762 |
762 /** | 763 /** |
763 * Creates a new content type object from parsing a Content-Type | 764 * Creates a new content type object from parsing a Content-Type |
764 * header value. As primary type, sub type and parameter names and | 765 * header value. As primary type, sub type and parameter names and |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1989 class RedirectException implements HttpException { | 1990 class RedirectException implements HttpException { |
1990 final String message; | 1991 final String message; |
1991 final List<RedirectInfo> redirects; | 1992 final List<RedirectInfo> redirects; |
1992 | 1993 |
1993 const RedirectException(this.message, this.redirects); | 1994 const RedirectException(this.message, this.redirects); |
1994 | 1995 |
1995 String toString() => "RedirectException: $message"; | 1996 String toString() => "RedirectException: $message"; |
1996 | 1997 |
1997 Uri get uri => redirects.last.location; | 1998 Uri get uri => redirects.last.location; |
1998 } | 1999 } |
OLD | NEW |