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

Side by Side Diff: pkg/http/lib/src/base_response.dart

Issue 11363063: Add an HTTP library that wraps dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « pkg/http/lib/src/base_request.dart ('k') | pkg/http/lib/src/client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library base_response;
6
7 import 'dart:io';
8
9 /// The base class for HTTP responses.
10 ///
11 /// Subclasses of [BaseResponse] are usually not constructed manually; instead,
12 /// they're returned by [BaseClient.send] or other HTTP client methods.
13 abstract class BaseResponse {
14 /// The status code of the response.
15 final int statusCode;
16
17 /// The reason phrase associated with the status code.
18 final String reasonPhrase;
19
20 /// The size of the response body, in bytes. If the size of the request is not
21 /// known in advance, this is -1.
22 final int contentLength;
23
24 // TODO(nweiz): automatically parse cookies from headers
25
26 // TODO(nweiz): make this a HttpHeaders object.
27 /// The headers for this response.
28 final Map<String, String> headers;
29
30 /// Whether this response is a redirect.
31 final bool isRedirect;
32
33 /// Whether the server requested that a persistent connection be maintained.
34 final bool persistentConnection;
35
36 /// Creates a new HTTP response.
37 BaseResponse(
38 this.statusCode,
39 this.contentLength,
40 {this.headers: const <String>{},
41 this.isRedirect: false,
42 this.persistentConnection: true,
43 this.reasonPhrase});
44 }
OLDNEW
« no previous file with comments | « pkg/http/lib/src/base_request.dart ('k') | pkg/http/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698