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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 static const int DEFAULT_HTTP_PORT = 80; | 1218 static const int DEFAULT_HTTP_PORT = 80; |
1219 static const int DEFAULT_HTTPS_PORT = 443; | 1219 static const int DEFAULT_HTTPS_PORT = 443; |
1220 | 1220 |
1221 /** | 1221 /** |
1222 * Get and set the idle timeout of non-active persistent (keep-alive) | 1222 * Get and set the idle timeout of non-active persistent (keep-alive) |
1223 * connections. The default value is 15 seconds. | 1223 * connections. The default value is 15 seconds. |
1224 */ | 1224 */ |
1225 Duration idleTimeout; | 1225 Duration idleTimeout; |
1226 | 1226 |
1227 /** | 1227 /** |
| 1228 * Get and set the maximum number of live connections, to a single host. |
| 1229 * |
| 1230 * Increasing this number may lower performance and take up unwanted |
| 1231 * system resources. |
| 1232 * |
| 1233 * To disable, set to `null`. |
| 1234 * |
| 1235 * Default is `null`. |
| 1236 */ |
| 1237 int maxConnectionsPerHost; |
| 1238 |
| 1239 /** |
1228 * Set and get the default value of the `User-Agent` header for all requests | 1240 * Set and get the default value of the `User-Agent` header for all requests |
1229 * generated by this [HttpClient]. The default value is | 1241 * generated by this [HttpClient]. The default value is |
1230 * `Dart/<version> (dart:io)`. | 1242 * `Dart/<version> (dart:io)`. |
1231 * | 1243 * |
1232 * If the userAgent is set to `null`, no default `User-Agent` header will be | 1244 * If the userAgent is set to `null`, no default `User-Agent` header will be |
1233 * added to each request. | 1245 * added to each request. |
1234 */ | 1246 */ |
1235 String userAgent; | 1247 String userAgent; |
1236 | 1248 |
1237 factory HttpClient() => new _HttpClient(); | 1249 factory HttpClient() => new _HttpClient(); |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 class RedirectException implements HttpException { | 1925 class RedirectException implements HttpException { |
1914 final String message; | 1926 final String message; |
1915 final List<RedirectInfo> redirects; | 1927 final List<RedirectInfo> redirects; |
1916 | 1928 |
1917 const RedirectException(this.message, this.redirects); | 1929 const RedirectException(this.message, this.redirects); |
1918 | 1930 |
1919 String toString() => "RedirectException: $message"; | 1931 String toString() => "RedirectException: $message"; |
1920 | 1932 |
1921 Uri get uri => redirects.last.location; | 1933 Uri get uri => redirects.last.location; |
1922 } | 1934 } |
OLD | NEW |