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

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

Issue 14914002: Change fromString constructor to parse static method (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed additional tests Created 7 years, 7 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 | pkg/http/lib/src/response.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library request; 5 library request;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:typed_data'; 9 import 'dart:typed_data';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 ByteStream finalize() { 147 ByteStream finalize() {
148 super.finalize(); 148 super.finalize();
149 return new ByteStream.fromBytes(bodyBytes); 149 return new ByteStream.fromBytes(bodyBytes);
150 } 150 }
151 151
152 /// The `Content-Type` header of the request (if it exists) as a 152 /// The `Content-Type` header of the request (if it exists) as a
153 /// [ContentType]. 153 /// [ContentType].
154 ContentType get _contentType { 154 ContentType get _contentType {
155 var contentType = headers[HttpHeaders.CONTENT_TYPE]; 155 var contentType = headers[HttpHeaders.CONTENT_TYPE];
156 if (contentType == null) return null; 156 if (contentType == null) return null;
157 return new ContentType.fromString(contentType); 157 return ContentType.parse(contentType);
158 } 158 }
159 159
160 set _contentType(ContentType value) { 160 set _contentType(ContentType value) {
161 headers[HttpHeaders.CONTENT_TYPE] = value.toString(); 161 headers[HttpHeaders.CONTENT_TYPE] = value.toString();
162 } 162 }
163 163
164 /// Throw an error if this request has been finalized. 164 /// Throw an error if this request has been finalized.
165 void _checkFinalized() { 165 void _checkFinalized() {
166 if (!finalized) return; 166 if (!finalized) return;
167 throw new StateError("Can't modify a finalized Request."); 167 throw new StateError("Can't modify a finalized Request.");
168 } 168 }
169 } 169 }
OLDNEW
« no previous file with comments | « no previous file | pkg/http/lib/src/response.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698