Chromium Code Reviews| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 | 159 |
| 160 /** | 160 /** |
| 161 * Gets and sets the keep alive state of the connection. If the | 161 * Gets and sets the keep alive state of the connection. If the |
| 162 * associated request have a keep alive state of false setting keep | 162 * associated request have a keep alive state of false setting keep |
| 163 * alive to true will have no effect. | 163 * alive to true will have no effect. |
| 164 */ | 164 */ |
| 165 void set keepAlive(bool keepAlive); | 165 void set keepAlive(bool keepAlive); |
| 166 bool get keepAlive(); | 166 bool get keepAlive(); |
| 167 | 167 |
| 168 /** | 168 /** |
| 169 * Gets and sets the status code. Any integer value is accepted, but | |
| 170 * for the official HTTP status codes use the fields from | |
| 171 * [HttpStatus]. | |
| 172 */ | |
| 173 int get statusCode(); | |
|
Mads Ager (google)
2012/02/29 12:34:12
These in the interface should just be
int statusC
Søren Gjesse
2012/02/29 12:50:07
Good point. Did the same for contentLength and kee
| |
| 174 void set statusCode(int statusCode); | |
| 175 | |
| 176 /** | |
| 177 * Gets and sets the reason phrase. If no reason phrase is explicitly | |
| 178 * set a default reason phrase is provided. | |
| 179 */ | |
| 180 String get reasonPhrase(); | |
| 181 void set reasonPhrase(String reasonPhrase); | |
| 182 | |
| 183 /** | |
| 169 * Sets a header on the response. NOTE: If the same header name is | 184 * Sets a header on the response. NOTE: If the same header name is |
| 170 * set more than once only the last value will be part of the | 185 * set more than once only the last value will be part of the |
| 171 * response. | 186 * response. |
| 172 */ | 187 */ |
| 173 void setHeader(String name, String value); | 188 void setHeader(String name, String value); |
| 174 | 189 |
| 175 /** | 190 /** |
| 176 * Returns the output stream for the response. This is used to write | 191 * Returns the output stream for the response. This is used to write |
| 177 * the response data. When all response data has been written close | 192 * the response data. When all response data has been written close |
| 178 * the stream to indicate the end of the response. | 193 * the stream to indicate the end of the response. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 */ | 352 */ |
| 338 InputStream get inputStream(); | 353 InputStream get inputStream(); |
| 339 } | 354 } |
| 340 | 355 |
| 341 | 356 |
| 342 class HttpException implements Exception { | 357 class HttpException implements Exception { |
| 343 const HttpException([String this.message = ""]); | 358 const HttpException([String this.message = ""]); |
| 344 String toString() => "HttpException: $message"; | 359 String toString() => "HttpException: $message"; |
| 345 final String message; | 360 final String message; |
| 346 } | 361 } |
| OLD | NEW |