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 library streamed_request; | 5 library streamed_request; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:uri'; | |
10 | 9 |
11 import 'byte_stream.dart'; | 10 import 'byte_stream.dart'; |
12 import 'base_request.dart'; | 11 import 'base_request.dart'; |
13 | 12 |
14 /// An HTTP request where the request body is sent asynchronously after the | 13 /// An HTTP request where the request body is sent asynchronously after the |
15 /// connection has been established and the headers have been sent. | 14 /// connection has been established and the headers have been sent. |
16 /// | 15 /// |
17 /// When the request is sent via [BaseClient.send], only the headers and | 16 /// When the request is sent via [BaseClient.send], only the headers and |
18 /// whatever data has already been written to [StreamedRequest.stream] will be | 17 /// whatever data has already been written to [StreamedRequest.stream] will be |
19 /// sent immediately. More data will be sent as soon as it's written to | 18 /// sent immediately. More data will be sent as soon as it's written to |
(...skipping 16 matching lines...) Expand all Loading... |
36 _controller = new StreamController<List<int>>(); | 35 _controller = new StreamController<List<int>>(); |
37 | 36 |
38 /// Freezes all mutable fields other than [stream] and returns a | 37 /// Freezes all mutable fields other than [stream] and returns a |
39 /// single-subscription [ByteStream] that emits the data being written to | 38 /// single-subscription [ByteStream] that emits the data being written to |
40 /// [sink]. | 39 /// [sink]. |
41 ByteStream finalize() { | 40 ByteStream finalize() { |
42 super.finalize(); | 41 super.finalize(); |
43 return new ByteStream(_controller.stream); | 42 return new ByteStream(_controller.stream); |
44 } | 43 } |
45 } | 44 } |
OLD | NEW |