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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 * the server. This object contains the headers and body of the | 799 * the server. This object contains the headers and body of the |
800 * response. | 800 * response. |
801 | 801 |
802 * The future for [HttpClientRequest] is created by methods such as | 802 * The future for [HttpClientRequest] is created by methods such as |
803 * [getUrl] and [open]. | 803 * [getUrl] and [open]. |
804 * | 804 * |
805 * When the HTTP response is ready a [HttpClientResponse] object is | 805 * When the HTTP response is ready a [HttpClientResponse] object is |
806 * provided which provides access to the headers and body of the response. | 806 * provided which provides access to the headers and body of the response. |
807 * | 807 * |
808 * HttpClient client = new HttpClient(); | 808 * HttpClient client = new HttpClient(); |
809 * client.getUrl(new Uri.fromString("http://www.example.com/")) | 809 * client.getUrl(Uri.parse("http://www.example.com/")) |
810 * .then((HttpClientRequest request) { | 810 * .then((HttpClientRequest request) { |
811 * // Prepare the request then call close on it to send it. | 811 * // Prepare the request then call close on it to send it. |
812 * return request.close(); | 812 * return request.close(); |
813 * }) | 813 * }) |
814 * .then((HttpClientResponse response) { | 814 * .then((HttpClientResponse response) { |
815 * // Process the response. | 815 * // Process the response. |
816 * }); | 816 * }); |
817 * | 817 * |
818 * All [HttpClient] requests set the following header by default: | 818 * All [HttpClient] requests set the following header by default: |
819 * | 819 * |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 class RedirectLimitExceededException extends RedirectException { | 1320 class RedirectLimitExceededException extends RedirectException { |
1321 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1321 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
1322 : super("Redirect limit exceeded", redirects); | 1322 : super("Redirect limit exceeded", redirects); |
1323 } | 1323 } |
1324 | 1324 |
1325 | 1325 |
1326 class RedirectLoopException extends RedirectException { | 1326 class RedirectLoopException extends RedirectException { |
1327 const RedirectLoopException(List<RedirectInfo> redirects) | 1327 const RedirectLoopException(List<RedirectInfo> redirects) |
1328 : super("Redirect loop detected", redirects); | 1328 : super("Redirect loop detected", redirects); |
1329 } | 1329 } |
OLD | NEW |