| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 static const int BAD_GATEWAY = 502; | 48 static const int BAD_GATEWAY = 502; |
| 49 static const int SERVICE_UNAVAILABLE = 503; | 49 static const int SERVICE_UNAVAILABLE = 503; |
| 50 static const int GATEWAY_TIMEOUT = 504; | 50 static const int GATEWAY_TIMEOUT = 504; |
| 51 static const int HTTP_VERSION_NOT_SUPPORTED = 505; | 51 static const int HTTP_VERSION_NOT_SUPPORTED = 505; |
| 52 // Client generated status code. | 52 // Client generated status code. |
| 53 static const int NETWORK_CONNECT_TIMEOUT_ERROR = 599; | 53 static const int NETWORK_CONNECT_TIMEOUT_ERROR = 599; |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * The [HttpServer] class implements the server side of the HTTP | 58 * A server that delivers content, such as web pages, using |
| 59 * protocol. The [HttpServer] is a [Stream] of [HttpRequest]s. Each | 59 * the HTTP protocol. |
| 60 * |
| 61 * The [HttpServer] is a [Stream] of [HttpRequest]s. Each |
| 60 * [HttpRequest] has an associated [HttpResponse] object as its | 62 * [HttpRequest] has an associated [HttpResponse] object as its |
| 61 * [HttpRequest.response] member, and the server responds to a request by | 63 * [HttpRequest.response] member, and the server responds to a request by |
| 62 * writing to that [HttpResponse] object. | 64 * writing to that [HttpResponse] object. |
| 63 * | 65 * |
| 64 * Incomplete requests where all or parts of the header is missing, are | 66 * Incomplete requests where all or parts of the header is missing, are |
| 65 * ignored and no exceptions or [HttpRequest] objects are generated for them. | 67 * ignored and no exceptions or [HttpRequest] objects are generated for them. |
| 66 * Likewise, when writing to a [HttpResponse], any [Socket] exceptions are | 68 * Likewise, when writing to a [HttpResponse], any [Socket] exceptions are |
| 67 * ignored and any future writes are ignored. | 69 * ignored and any future writes are ignored. |
| 68 * | 70 * |
| 69 * The [HttpRequest] exposes the request headers, and provides the request body, | 71 * The [HttpRequest] exposes the request headers, and provides the request body, |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 | 945 |
| 944 /** | 946 /** |
| 945 * Gets information about the client connection. Returns [null] if the socket | 947 * Gets information about the client connection. Returns [null] if the socket |
| 946 * is not available. | 948 * is not available. |
| 947 */ | 949 */ |
| 948 HttpConnectionInfo get connectionInfo; | 950 HttpConnectionInfo get connectionInfo; |
| 949 } | 951 } |
| 950 | 952 |
| 951 | 953 |
| 952 /** | 954 /** |
| 953 * The [HttpClient] class implements the client side of the HTTP | 955 * A client that receives content, such as web pages, from |
| 954 * protocol. It contains a number of methods to send a HTTP request | 956 * a server using the HTTP protocol. |
| 957 * |
| 958 * HttpClient contains a number of methods to send a HTTP request |
| 955 * to a HTTP server and receive a HTTP response back. | 959 * to a HTTP server and receive a HTTP response back. |
| 956 * | 960 * |
| 957 * This is a two-step process, triggered by two futures. When the | 961 * This is a two-step process, triggered by two futures. When the |
| 958 * first future completes with a [HttpClientRequest] the underlying | 962 * first future completes with a [HttpClientRequest] the underlying |
| 959 * network connection has been established, but no data has yet been | 963 * network connection has been established, but no data has yet been |
| 960 * sent. The HTTP headers and body can be set on the request, and | 964 * sent. The HTTP headers and body can be set on the request, and |
| 961 * [:close:] is called to sent it to the server. | 965 * [:close:] is called to sent it to the server. |
| 962 * | 966 * |
| 963 * The second future, which is returned by [:close:], completes with | 967 * The second future, which is returned by [:close:], completes with |
| 964 * an [HttpClientResponse] object when the response is received from | 968 * an [HttpClientResponse] object when the response is received from |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 final String message; | 1587 final String message; |
| 1584 final List<RedirectInfo> redirects; | 1588 final List<RedirectInfo> redirects; |
| 1585 | 1589 |
| 1586 const RedirectException(String this.message, | 1590 const RedirectException(String this.message, |
| 1587 List<RedirectInfo> this.redirects); | 1591 List<RedirectInfo> this.redirects); |
| 1588 | 1592 |
| 1589 String toString() => "RedirectException: $message"; | 1593 String toString() => "RedirectException: $message"; |
| 1590 | 1594 |
| 1591 Uri get uri => redirects.last.location; | 1595 Uri get uri => redirects.last.location; |
| 1592 } | 1596 } |
| OLD | NEW |