| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 * used to register callbacks for asynchronous events on the HTTP | 409 * used to register callbacks for asynchronous events on the HTTP |
| 410 * connection. The "Host" header for the request will be set based | 410 * connection. The "Host" header for the request will be set based |
| 411 * the host and port specified in [url]. This can be overridden | 411 * the host and port specified in [url]. This can be overridden |
| 412 * through the HttpClientRequest interface before the request is | 412 * through the HttpClientRequest interface before the request is |
| 413 * sent. NOTE if the host is specified as an IP address this will | 413 * sent. NOTE if the host is specified as an IP address this will |
| 414 * still be set in the "Host" header. | 414 * still be set in the "Host" header. |
| 415 */ | 415 */ |
| 416 HttpClientConnection openUrl(String method, Uri url); | 416 HttpClientConnection openUrl(String method, Uri url); |
| 417 | 417 |
| 418 /** | 418 /** |
| 419 * Opens a HTTP connection using the GET method. See [open] for details. | 419 * Opens a HTTP connection using the GET method. See [open] for |
| 420 * details. Using this method to open a HTTP connection will set the |
| 421 * content length to 0. |
| 420 */ | 422 */ |
| 421 HttpClientConnection get(String host, int port, String path); | 423 HttpClientConnection get(String host, int port, String path); |
| 422 | 424 |
| 423 /** | 425 /** |
| 424 * Opens a HTTP connection using the GET method. See [openUrl] for details. | 426 * Opens a HTTP connection using the GET method. See [openUrl] for |
| 427 * details. Using this method to open a HTTP connection will set the |
| 428 * content length to 0. |
| 425 */ | 429 */ |
| 426 HttpClientConnection getUrl(Uri url); | 430 HttpClientConnection getUrl(Uri url); |
| 427 | 431 |
| 428 /** | 432 /** |
| 429 * Opens a HTTP connection using the POST method. See [open] for details. | 433 * Opens a HTTP connection using the POST method. See [open] for details. |
| 430 */ | 434 */ |
| 431 HttpClientConnection post(String host, int port, String path); | 435 HttpClientConnection post(String host, int port, String path); |
| 432 | 436 |
| 433 /** | 437 /** |
| 434 * Opens a HTTP connection using the POST method. See [openUrl] for details. | 438 * Opens a HTTP connection using the POST method. See [openUrl] for details. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 */ | 538 */ |
| 535 InputStream get inputStream(); | 539 InputStream get inputStream(); |
| 536 } | 540 } |
| 537 | 541 |
| 538 | 542 |
| 539 class HttpException implements Exception { | 543 class HttpException implements Exception { |
| 540 const HttpException([String this.message = ""]); | 544 const HttpException([String this.message = ""]); |
| 541 String toString() => "HttpException: $message"; | 545 String toString() => "HttpException: $message"; |
| 542 final String message; | 546 final String message; |
| 543 } | 547 } |
| OLD | NEW |