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 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 /** | 1790 /** |
1791 * Get information about the client connection. Returns [:null:] if the socket | 1791 * Get information about the client connection. Returns [:null:] if the socket |
1792 * is not available. | 1792 * is not available. |
1793 */ | 1793 */ |
1794 HttpConnectionInfo get connectionInfo; | 1794 HttpConnectionInfo get connectionInfo; |
1795 } | 1795 } |
1796 | 1796 |
1797 | 1797 |
1798 /** | 1798 /** |
1799 * HTTP response for a client connection. | 1799 * HTTP response for a client connection. |
1800 | 1800 * |
1801 * The body of a [HttpClientResponse] object is a | 1801 * The body of a [HttpClientResponse] object is a |
1802 * [Stream] of data from the server. Listen to the body to handle | 1802 * [Stream] of data from the server. Listen to the body to handle |
1803 * the data and be notified when the entire body is received. | 1803 * the data and be notified when the entire body is received. |
1804 * | 1804 * |
1805 * new HttpClient().get('localhost', 80, '/file.txt') | 1805 * new HttpClient().get('localhost', 80, '/file.txt') |
1806 * .then((HttpClientRequest request) => request.close()) | 1806 * .then((HttpClientRequest request) => request.close()) |
1807 * .then((HttpClientResponse response) { | 1807 * .then((HttpClientResponse response) { |
1808 * response.transform(UTF8.decoder).listen((contents) { | 1808 * response.transform(UTF8.decoder).listen((contents) { |
1809 * // handle data | 1809 * // handle data |
1810 * }); | 1810 * }); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2010 class RedirectException implements HttpException { | 2010 class RedirectException implements HttpException { |
2011 final String message; | 2011 final String message; |
2012 final List<RedirectInfo> redirects; | 2012 final List<RedirectInfo> redirects; |
2013 | 2013 |
2014 const RedirectException(this.message, this.redirects); | 2014 const RedirectException(this.message, this.redirects); |
2015 | 2015 |
2016 String toString() => "RedirectException: $message"; | 2016 String toString() => "RedirectException: $message"; |
2017 | 2017 |
2018 Uri get uri => redirects.last.location; | 2018 Uri get uri => redirects.last.location; |
2019 } | 2019 } |
OLD | NEW |