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 http.utils; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 import 'dart:convert'; | 6 import 'dart:convert'; |
9 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
10 | 8 |
11 import 'byte_stream.dart'; | 9 import 'byte_stream.dart'; |
12 | 10 |
13 /// Converts a URL query string (or `application/x-www-form-urlencoded` body) | 11 /// Converts a URL query string (or `application/x-www-form-urlencoded` body) |
14 /// into a [Map] from parameter names to values. | 12 /// into a [Map] from parameter names to values. |
15 /// | 13 /// |
16 /// queryToMap("foo=bar&baz=bang&qux"); | 14 /// queryToMap("foo=bar&baz=bang&qux"); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 185 } |
188 | 186 |
189 int get hashCode => first.hashCode ^ last.hashCode; | 187 int get hashCode => first.hashCode ^ last.hashCode; |
190 } | 188 } |
191 | 189 |
192 /// Configures [future] so that its result (success or exception) is passed on | 190 /// Configures [future] so that its result (success or exception) is passed on |
193 /// to [completer]. | 191 /// to [completer]. |
194 void chainToCompleter(Future future, Completer completer) { | 192 void chainToCompleter(Future future, Completer completer) { |
195 future.then(completer.complete, onError: completer.completeError); | 193 future.then(completer.complete, onError: completer.completeError); |
196 } | 194 } |
OLD | NEW |