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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1230 * Increasing this number may lower performance and take up unwanted | 1230 * Increasing this number may lower performance and take up unwanted |
1231 * system resources. | 1231 * system resources. |
1232 * | 1232 * |
1233 * To disable, set to `null`. | 1233 * To disable, set to `null`. |
1234 * | 1234 * |
1235 * Default is `null`. | 1235 * Default is `null`. |
1236 */ | 1236 */ |
1237 int maxConnectionsPerHost; | 1237 int maxConnectionsPerHost; |
1238 | 1238 |
1239 /** | 1239 /** |
1240 * Get and set whether the body of a response will be automatically | |
1241 * uncompressed. | |
1242 * | |
1243 * If the client want to process the body then getting the already | |
Anders Johnsen
2014/07/04 10:56:39
This sentence is a bit hard to read.
Søren Gjesse
2014/07/04 11:14:01
Rephrased.
| |
1244 * uncompressed is convenient. However in some situations | |
1245 * (e.g. implementing a transparent proxy) keeping the uncompressed | |
1246 * stream is required. | |
1247 * | |
1248 * NOTE: When automatic un-compression is turned on the value of the | |
Anders Johnsen
2014/07/04 10:56:39
Maybe state that 'No headers are modified', to be
Søren Gjesse
2014/07/04 11:14:01
Done.
| |
1249 * header `Content-Length` will reflect the length of the original | |
1250 * compressed body. Likewise the header `Content-Encoding` will also | |
1251 * have the original value indicating compression. | |
1252 * | |
1253 * NOTE: Automatic un-compression is only supported when the | |
Anders Johnsen
2014/07/04 10:56:39
supported -> performed/done
when -> if
Søren Gjesse
2014/07/04 11:14:01
Done.
| |
1254 * `Content-Encoding` used is `gzip`. | |
Anders Johnsen
2014/07/04 10:56:39
used -> header
Søren Gjesse
2014/07/04 11:14:01
Done.
| |
1255 * | |
1256 * This value affects all responses produced by this client after the | |
1257 * value is changed. | |
1258 * | |
1259 * To disable, set to `false`. | |
1260 * | |
1261 * Default is `true`. | |
1262 */ | |
1263 bool autoUncompress; | |
1264 | |
1265 /** | |
1240 * Set and get the default value of the `User-Agent` header for all requests | 1266 * Set and get the default value of the `User-Agent` header for all requests |
1241 * generated by this [HttpClient]. The default value is | 1267 * generated by this [HttpClient]. The default value is |
1242 * `Dart/<version> (dart:io)`. | 1268 * `Dart/<version> (dart:io)`. |
1243 * | 1269 * |
1244 * If the userAgent is set to `null`, no default `User-Agent` header will be | 1270 * If the userAgent is set to `null`, no default `User-Agent` header will be |
1245 * added to each request. | 1271 * added to each request. |
1246 */ | 1272 */ |
1247 String userAgent; | 1273 String userAgent; |
1248 | 1274 |
1249 factory HttpClient() => new _HttpClient(); | 1275 factory HttpClient() => new _HttpClient(); |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1925 class RedirectException implements HttpException { | 1951 class RedirectException implements HttpException { |
1926 final String message; | 1952 final String message; |
1927 final List<RedirectInfo> redirects; | 1953 final List<RedirectInfo> redirects; |
1928 | 1954 |
1929 const RedirectException(this.message, this.redirects); | 1955 const RedirectException(this.message, this.redirects); |
1930 | 1956 |
1931 String toString() => "RedirectException: $message"; | 1957 String toString() => "RedirectException: $message"; |
1932 | 1958 |
1933 Uri get uri => redirects.last.location; | 1959 Uri get uri => redirects.last.location; |
1934 } | 1960 } |
OLD | NEW |