| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 | 762 |
| 763 | 763 |
| 764 /** | 764 /** |
| 765 * HTTP client factory. The [HttpClient] handles all the sockets associated | 765 * HTTP client factory. The [HttpClient] handles all the sockets associated |
| 766 * with the [HttpClientConnection]s and when the endpoint supports it, it will | 766 * with the [HttpClientConnection]s and when the endpoint supports it, it will |
| 767 * try to reuse opened sockets for several requests to support HTTP 1.1 | 767 * try to reuse opened sockets for several requests to support HTTP 1.1 |
| 768 * persistent connections. This means that sockets will be kept open for some | 768 * persistent connections. This means that sockets will be kept open for some |
| 769 * time after a requests have completed, unless HTTP procedures indicate that it | 769 * time after a requests have completed, unless HTTP procedures indicate that it |
| 770 * must be closed as part of completing the request. Use [:HttpClient.close:] | 770 * must be closed as part of completing the request. Use [:HttpClient.close:] |
| 771 * to force close the idle sockets. | 771 * to force close the idle sockets. |
| 772 * |
| 773 * By default the HttpClient uses the proxy configuration available |
| 774 * from the environment, see [findProxyFromEnvironment]. To turn off |
| 775 * the use of proxies all together set the [findProxy] property to |
| 776 * [:null:]. |
| 777 * |
| 778 * HttpClient client = new HttpClient(); |
| 779 * client.findProxy = null; |
| 772 */ | 780 */ |
| 773 abstract class HttpClient { | 781 abstract class HttpClient { |
| 774 static const int DEFAULT_HTTP_PORT = 80; | 782 static const int DEFAULT_HTTP_PORT = 80; |
| 775 static const int DEFAULT_HTTPS_PORT = 443; | 783 static const int DEFAULT_HTTPS_PORT = 443; |
| 776 | 784 |
| 777 factory HttpClient() => new _HttpClient(); | 785 factory HttpClient() => new _HttpClient(); |
| 778 | 786 |
| 779 /** | 787 /** |
| 780 * Opens a HTTP connection. The returned [HttpClientRequest] is used to | 788 * Opens a HTTP connection. The returned [HttpClientRequest] is used to |
| 781 * fill in the content of the request before sending it. The 'host' header for | 789 * fill in the content of the request before sending it. The 'host' header for |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 class RedirectLimitExceededException extends RedirectException { | 1227 class RedirectLimitExceededException extends RedirectException { |
| 1220 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1228 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
| 1221 : super("Redirect limit exceeded", redirects); | 1229 : super("Redirect limit exceeded", redirects); |
| 1222 } | 1230 } |
| 1223 | 1231 |
| 1224 | 1232 |
| 1225 class RedirectLoopException extends RedirectException { | 1233 class RedirectLoopException extends RedirectException { |
| 1226 const RedirectLoopException(List<RedirectInfo> redirects) | 1234 const RedirectLoopException(List<RedirectInfo> redirects) |
| 1227 : super("Redirect loop detected", redirects); | 1235 : super("Redirect loop detected", redirects); |
| 1228 } | 1236 } |
| OLD | NEW |