| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 * the response is ready for processing. The callback is called when | 285 * the response is ready for processing. The callback is called when |
| 286 * all headers of the response are received and data is ready to be | 286 * all headers of the response are received and data is ready to be |
| 287 * received. | 287 * received. |
| 288 */ | 288 */ |
| 289 void set onResponse(void handler(HttpClientResponse response)); | 289 void set onResponse(void handler(HttpClientResponse response)); |
| 290 | 290 |
| 291 /** | 291 /** |
| 292 * Sets the handler that gets called if an error occurs while | 292 * Sets the handler that gets called if an error occurs while |
| 293 * processing the HTTP request. | 293 * processing the HTTP request. |
| 294 */ | 294 */ |
| 295 void set onError(void handler(HttpException e)); | 295 void set onError(void handler(HttpException e)); |
| 296 } | 296 } |
| 297 | 297 |
| 298 | 298 |
| 299 /** | 299 /** |
| 300 * HTTP request for a client connection. | 300 * HTTP request for a client connection. |
| 301 */ | 301 */ |
| 302 interface HttpClientRequest default _HttpClientRequest { | 302 interface HttpClientRequest default _HttpClientRequest { |
| 303 /** | 303 /** |
| 304 * Gets and sets the content length of the request. If the size of | 304 * Gets and sets the content length of the request. If the size of |
| 305 * the request is not known in advance set content length to -1, | 305 * the request is not known in advance set content length to -1, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 */ | 395 */ |
| 396 InputStream get inputStream(); | 396 InputStream get inputStream(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 | 399 |
| 400 class HttpException implements Exception { | 400 class HttpException implements Exception { |
| 401 const HttpException([String this.message = ""]); | 401 const HttpException([String this.message = ""]); |
| 402 String toString() => "HttpException: $message"; | 402 String toString() => "HttpException: $message"; |
| 403 final String message; | 403 final String message; |
| 404 } | 404 } |
| OLD | NEW |