Chromium Code Reviews| 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 824 * connections are done. If [force] is [:true:] any active | 824 * connections are done. If [force] is [:true:] any active |
| 825 * connections will be closed to immediately release all | 825 * connections will be closed to immediately release all |
| 826 * resources. These closed connections will receive an [:onError:] | 826 * resources. These closed connections will receive an [:onError:] |
| 827 * callback to indicate that the client was shutdown. In both cases | 827 * callback to indicate that the client was shutdown. In both cases |
| 828 * trying to establish a new connection after calling [shutdown] | 828 * trying to establish a new connection after calling [shutdown] |
| 829 * will throw an exception. | 829 * will throw an exception. |
| 830 */ | 830 */ |
| 831 void close({bool force: false}); | 831 void close({bool force: false}); |
| 832 } | 832 } |
| 833 | 833 |
| 834 /** | |
|
Anders Johnsen
2013/01/29 08:25:41
Thank you! :)
| |
| 835 * DEPRECATED | |
| 836 */ | |
| 837 abstract class HttpClientConnection { | |
| 838 // TODO(ajohnsen): Move these methods to the right place (request or response) | |
| 839 | |
| 840 | |
| 841 /** | |
| 842 * Get information about the client connection. Returns [null] if the socket | |
| 843 * isn't available. | |
| 844 */ | |
| 845 HttpConnectionInfo get connectionInfo; | |
| 846 } | |
| 847 | |
| 848 | 834 |
| 849 /** | 835 /** |
| 850 * HTTP request for a client connection. | 836 * HTTP request for a client connection. |
| 851 * | 837 * |
| 852 * The request is an [IOStreamConsumer], used to write the request data. When | 838 * The request is an [IOStreamConsumer], used to write the request data. When |
| 853 * all request data has been written, close the stream to indicate the end of | 839 * all request data has been written, close the stream to indicate the end of |
| 854 * the request. | 840 * the request. |
| 855 * | 841 * |
| 856 * When this is accessed for the first time the request header is | 842 * When this is accessed for the first time the request header is |
| 857 * send. Calling any methods that will change the header after | 843 * send. Calling any methods that will change the header after |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 */ | 900 */ |
| 915 bool followRedirects; | 901 bool followRedirects; |
| 916 | 902 |
| 917 /** | 903 /** |
| 918 * Set this property to the maximum number of redirects to follow | 904 * Set this property to the maximum number of redirects to follow |
| 919 * when [followRedirects] is [:true:]. If this number is exceeded the | 905 * when [followRedirects] is [:true:]. If this number is exceeded the |
| 920 * [onError] callback will be called with a [RedirectLimitExceeded] | 906 * [onError] callback will be called with a [RedirectLimitExceeded] |
| 921 * exception. The default value is 5. | 907 * exception. The default value is 5. |
| 922 */ | 908 */ |
| 923 int maxRedirects; | 909 int maxRedirects; |
| 910 | |
| 911 /** | |
| 912 * Get information about the client connection. Returns [null] if the socket | |
| 913 * isn't available. | |
| 914 */ | |
| 915 HttpConnectionInfo get connectionInfo; | |
| 924 } | 916 } |
| 925 | 917 |
| 926 | 918 |
| 927 /** | 919 /** |
| 928 * HTTP response for a client connection. The [HttpClientResponse] is a | 920 * HTTP response for a client connection. The [HttpClientResponse] is a |
| 929 * [Stream] of the body content of the response. Listen to the body to handle | 921 * [Stream] of the body content of the response. Listen to the body to handle |
| 930 * the data and be notified once the entire body is received. | 922 * the data and be notified once the entire body is received. |
| 931 | 923 |
| 932 */ | 924 */ |
| 933 abstract class HttpClientResponse implements Stream<List<int>> { | 925 abstract class HttpClientResponse implements Stream<List<int>> { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1006 /** | 998 /** |
| 1007 * Cookies set by the server (from the Set-Cookie header). | 999 * Cookies set by the server (from the Set-Cookie header). |
| 1008 */ | 1000 */ |
| 1009 List<Cookie> get cookies; | 1001 List<Cookie> get cookies; |
| 1010 | 1002 |
| 1011 /** | 1003 /** |
| 1012 * Returns the certificate of the HTTPS server providing the response. | 1004 * Returns the certificate of the HTTPS server providing the response. |
| 1013 * Returns null if the connection is not a secure TLS or SSL connection. | 1005 * Returns null if the connection is not a secure TLS or SSL connection. |
| 1014 */ | 1006 */ |
| 1015 X509Certificate get certificate; | 1007 X509Certificate get certificate; |
| 1008 | |
| 1009 /** | |
| 1010 * Get information about the client connection. Returns [null] if the socket | |
| 1011 * isn't available. | |
| 1012 */ | |
| 1013 HttpConnectionInfo get connectionInfo; | |
| 1016 } | 1014 } |
| 1017 | 1015 |
| 1018 | 1016 |
| 1019 abstract class HttpClientCredentials { } | 1017 abstract class HttpClientCredentials { } |
| 1020 | 1018 |
| 1021 | 1019 |
| 1022 /** | 1020 /** |
| 1023 * Represent credentials for basic authentication. | 1021 * Represent credentials for basic authentication. |
| 1024 */ | 1022 */ |
| 1025 abstract class HttpClientBasicCredentials extends HttpClientCredentials { | 1023 abstract class HttpClientBasicCredentials extends HttpClientCredentials { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1098 class RedirectLimitExceededException extends RedirectException { | 1096 class RedirectLimitExceededException extends RedirectException { |
| 1099 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1097 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
| 1100 : super("Redirect limit exceeded", redirects); | 1098 : super("Redirect limit exceeded", redirects); |
| 1101 } | 1099 } |
| 1102 | 1100 |
| 1103 | 1101 |
| 1104 class RedirectLoopException extends RedirectException { | 1102 class RedirectLoopException extends RedirectException { |
| 1105 const RedirectLoopException(List<RedirectInfo> redirects) | 1103 const RedirectLoopException(List<RedirectInfo> redirects) |
| 1106 : super("Redirect loop detected", redirects); | 1104 : super("Redirect loop detected", redirects); |
| 1107 } | 1105 } |
| OLD | NEW |