| OLD | NEW |
| 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'; | |
| 11 | 10 |
| 12 import 'base_request.dart'; | 11 import 'base_request.dart'; |
| 13 import 'byte_stream.dart'; | 12 import 'byte_stream.dart'; |
| 14 import 'utils.dart'; | 13 import 'utils.dart'; |
| 15 | 14 |
| 16 /// An HTTP request where the entire request body is known in advance. | 15 /// An HTTP request where the entire request body is known in advance. |
| 17 class Request extends BaseRequest { | 16 class Request extends BaseRequest { |
| 18 /// The size of the request body, in bytes. This is calculated from | 17 /// The size of the request body, in bytes. This is calculated from |
| 19 /// [bodyBytes]. | 18 /// [bodyBytes]. |
| 20 /// | 19 /// |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 set _contentType(ContentType value) { | 159 set _contentType(ContentType value) { |
| 161 headers[HttpHeaders.CONTENT_TYPE] = value.toString(); | 160 headers[HttpHeaders.CONTENT_TYPE] = value.toString(); |
| 162 } | 161 } |
| 163 | 162 |
| 164 /// Throw an error if this request has been finalized. | 163 /// Throw an error if this request has been finalized. |
| 165 void _checkFinalized() { | 164 void _checkFinalized() { |
| 166 if (!finalized) return; | 165 if (!finalized) return; |
| 167 throw new StateError("Can't modify a finalized Request."); | 166 throw new StateError("Can't modify a finalized Request."); |
| 168 } | 167 } |
| 169 } | 168 } |
| OLD | NEW |