| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 /** | 376 /** |
| 377 * Returns the output stream for the response. This is used to write | 377 * Returns the output stream for the response. This is used to write |
| 378 * the response data. When all response data has been written close | 378 * the response data. When all response data has been written close |
| 379 * the stream to indicate the end of the response. | 379 * the stream to indicate the end of the response. |
| 380 * | 380 * |
| 381 * When this is accessed for the first time the response header is | 381 * When this is accessed for the first time the response header is |
| 382 * send. Calling any methods that will change the header after | 382 * send. Calling any methods that will change the header after |
| 383 * having retrieved the output stream will throw an exception. | 383 * having retrieved the output stream will throw an exception. |
| 384 */ | 384 */ |
| 385 OutputStream get outputStream(); | 385 OutputStream get outputStream(); |
| 386 |
| 387 /** |
| 388 * Detach the underlying socket from the HTTP server. When the |
| 389 * socket is detached the HTTP server will no longer perform any |
| 390 * operations on it. |
| 391 * |
| 392 * This is normally used when a HTTP upgraded request is received |
| 393 * and the communication should continue with a different protocol. |
| 394 */ |
| 395 Socket detachSocket(); |
| 386 } | 396 } |
| 387 | 397 |
| 388 | 398 |
| 389 /** | 399 /** |
| 390 * HTTP client factory. | 400 * HTTP client factory. |
| 391 */ | 401 */ |
| 392 interface HttpClient default _HttpClient { | 402 interface HttpClient default _HttpClient { |
| 393 static final int DEFAULT_HTTP_PORT = 80; | 403 static final int DEFAULT_HTTP_PORT = 80; |
| 394 | 404 |
| 395 HttpClient(); | 405 HttpClient(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 */ | 545 */ |
| 536 InputStream get inputStream(); | 546 InputStream get inputStream(); |
| 537 } | 547 } |
| 538 | 548 |
| 539 | 549 |
| 540 class HttpException implements Exception { | 550 class HttpException implements Exception { |
| 541 const HttpException([String this.message = ""]); | 551 const HttpException([String this.message = ""]); |
| 542 String toString() => "HttpException: $message"; | 552 String toString() => "HttpException: $message"; |
| 543 final String message; | 553 final String message; |
| 544 } | 554 } |
| OLD | NEW |