| 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 interface HttpStatus { | 8 interface HttpStatus { |
| 9 static final int CONTINUE = 100; | 9 static final int CONTINUE = 100; |
| 10 static final int SWITCHING_PROTOCOLS = 101; | 10 static final int SWITCHING_PROTOCOLS = 101; |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 * operations on it. | 616 * operations on it. |
| 617 * | 617 * |
| 618 * This is normally used when a HTTP upgrade request is received | 618 * This is normally used when a HTTP upgrade request is received |
| 619 * and the communication should continue with a different protocol. | 619 * and the communication should continue with a different protocol. |
| 620 */ | 620 */ |
| 621 DetachedSocket detachSocket(); | 621 DetachedSocket detachSocket(); |
| 622 } | 622 } |
| 623 | 623 |
| 624 | 624 |
| 625 /** | 625 /** |
| 626 * HTTP client factory. | 626 * HTTP client factory. The [HttpClient] handles all the sockets associated |
| 627 * with the [HttpClientConnection]s and when the endpoint supports it, it will |
| 628 * try to reuse opened sockets for several requests to support HTTP 1.1 |
| 629 * persistent connections. This means that sockets will be kept open for some |
| 630 * time after a requests have completed, unless HTTP procedures indicate that it |
| 631 * must be closed as part of completing the request. Use [:HttpClient.shutdown:] |
| 632 * to force close the idle sockets. |
| 627 */ | 633 */ |
| 628 interface HttpClient default _HttpClient { | 634 interface HttpClient default _HttpClient { |
| 629 static final int DEFAULT_HTTP_PORT = 80; | 635 static final int DEFAULT_HTTP_PORT = 80; |
| 630 | 636 |
| 631 HttpClient(); | 637 HttpClient(); |
| 632 | 638 |
| 633 /** | 639 /** |
| 634 * Opens a HTTP connection. The returned [HttpClientConnection] is | 640 * Opens a HTTP connection. The returned [HttpClientConnection] is |
| 635 * used to register callbacks for asynchronous events on the HTTP | 641 * used to register callbacks for asynchronous events on the HTTP |
| 636 * connection. The "Host" header for the request will be set to the | 642 * connection. The "Host" header for the request will be set to the |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 class RedirectLimitExceededException extends RedirectException { | 901 class RedirectLimitExceededException extends RedirectException { |
| 896 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 902 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
| 897 : super("Redirect limit exceeded", redirects); | 903 : super("Redirect limit exceeded", redirects); |
| 898 } | 904 } |
| 899 | 905 |
| 900 | 906 |
| 901 class RedirectLoopException extends RedirectException { | 907 class RedirectLoopException extends RedirectException { |
| 902 const RedirectLoopException(List<RedirectInfo> redirects) | 908 const RedirectLoopException(List<RedirectInfo> redirects) |
| 903 : super("Redirect loop detected", redirects); | 909 : super("Redirect loop detected", redirects); |
| 904 } | 910 } |
| OLD | NEW |