Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: runtime/bin/http.dart

Issue 9602011: Add handling of HTTP header "Expires" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 */ 170 */
171 int statusCode; 171 int statusCode;
172 172
173 /** 173 /**
174 * Gets and sets the reason phrase. If no reason phrase is explicitly 174 * Gets and sets the reason phrase. If no reason phrase is explicitly
175 * set a default reason phrase is provided. 175 * set a default reason phrase is provided.
176 */ 176 */
177 String reasonPhrase; 177 String reasonPhrase;
178 178
179 /** 179 /**
180 * Gets and sets the expiry date. The value of this property will
181 * reflect the "Expires" header
182 */
183 Date expires;
184
185 /**
180 * Sets a header on the response. NOTE: If the same header name is 186 * Sets a header on the response. NOTE: If the same header name is
181 * set more than once only the last value will be part of the 187 * set more than once only the last value will be part of the
182 * response. 188 * response.
183 */ 189 */
184 void setHeader(String name, String value); 190 void setHeader(String name, String value);
185 191
186 /** 192 /**
187 * Returns the response headers. 193 * Returns the response headers.
188 */ 194 */
189 Map<String, String> get headers(); 195 Map<String, String> get headers();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 * the request body is not known in advance this -1. 365 * the request body is not known in advance this -1.
360 */ 366 */
361 int get contentLength(); 367 int get contentLength();
362 368
363 /** 369 /**
364 * Returns the keep alive state of the connection. 370 * Returns the keep alive state of the connection.
365 */ 371 */
366 bool get keepAlive(); 372 bool get keepAlive();
367 373
368 /** 374 /**
375 * Returns the date value for the "Expires" header. Returns null if
376 * the response has no "Expires" header. Throws a HttpException if
377 * the response has an "Expires" header which is not formatted as a
378 * valid HTTP date.
379 */
380 Date get expires();
381
382 /**
369 * Returns the response headers. 383 * Returns the response headers.
370 */ 384 */
371 Map<String, String> get headers(); 385 Map<String, String> get headers();
372 386
373 /** 387 /**
374 * Returns the input stream for the response. This is used to read 388 * Returns the input stream for the response. This is used to read
375 * the response data. 389 * the response data.
376 */ 390 */
377 InputStream get inputStream(); 391 InputStream get inputStream();
378 } 392 }
379 393
380 394
381 class HttpException implements Exception { 395 class HttpException implements Exception {
382 const HttpException([String this.message = ""]); 396 const HttpException([String this.message = ""]);
383 String toString() => "HttpException: $message"; 397 String toString() => "HttpException: $message";
384 final String message; 398 final String message;
385 } 399 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698