OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * HTTP status codes. | 6 * HTTP status codes. |
7 */ | 7 */ |
8 abstract class HttpStatus { | 8 abstract class HttpStatus { |
9 static const int CONTINUE = 100; | 9 static const int CONTINUE = 100; |
10 static const int SWITCHING_PROTOCOLS = 101; | 10 static const int SWITCHING_PROTOCOLS = 101; |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 * HTTP client factory. The [HttpClient] handles all the sockets associated | 727 * HTTP client factory. The [HttpClient] handles all the sockets associated |
728 * with the [HttpClientConnection]s and when the endpoint supports it, it will | 728 * with the [HttpClientConnection]s and when the endpoint supports it, it will |
729 * try to reuse opened sockets for several requests to support HTTP 1.1 | 729 * try to reuse opened sockets for several requests to support HTTP 1.1 |
730 * persistent connections. This means that sockets will be kept open for some | 730 * persistent connections. This means that sockets will be kept open for some |
731 * time after a requests have completed, unless HTTP procedures indicate that it | 731 * time after a requests have completed, unless HTTP procedures indicate that it |
732 * must be closed as part of completing the request. Use [:HttpClient.shutdown:] | 732 * must be closed as part of completing the request. Use [:HttpClient.shutdown:] |
733 * to force close the idle sockets. | 733 * to force close the idle sockets. |
734 */ | 734 */ |
735 abstract class HttpClient { | 735 abstract class HttpClient { |
736 static const int DEFAULT_HTTP_PORT = 80; | 736 static const int DEFAULT_HTTP_PORT = 80; |
| 737 static const int DEFAULT_HTTPS_PORT = 443; |
737 | 738 |
738 factory HttpClient() => new _HttpClient(); | 739 factory HttpClient() => new _HttpClient(); |
739 | 740 |
740 /** | 741 /** |
741 * Opens a HTTP connection. The returned [HttpClientConnection] is | 742 * Opens a HTTP connection. The returned [HttpClientConnection] is |
742 * used to register callbacks for asynchronous events on the HTTP | 743 * used to register callbacks for asynchronous events on the HTTP |
743 * connection. The "Host" header for the request will be set to the | 744 * connection. The "Host" header for the request will be set to the |
744 * value [host]:[port]. This can be overridden through the | 745 * value [host]:[port]. This can be overridden through the |
745 * HttpClientRequest interface before the request is sent. NOTE if | 746 * HttpClientRequest interface before the request is sent. NOTE if |
746 * [host] is an IP address this will still be set in the "Host" | 747 * [host] is an IP address this will still be set in the "Host" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 class RedirectLimitExceededException extends RedirectException { | 1093 class RedirectLimitExceededException extends RedirectException { |
1093 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1094 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
1094 : super("Redirect limit exceeded", redirects); | 1095 : super("Redirect limit exceeded", redirects); |
1095 } | 1096 } |
1096 | 1097 |
1097 | 1098 |
1098 class RedirectLoopException extends RedirectException { | 1099 class RedirectLoopException extends RedirectException { |
1099 const RedirectLoopException(List<RedirectInfo> redirects) | 1100 const RedirectLoopException(List<RedirectInfo> redirects) |
1100 : super("Redirect loop detected", redirects); | 1101 : super("Redirect loop detected", redirects); |
1101 } | 1102 } |
OLD | NEW |