Chromium Code Reviews| 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 /// Helpers for dealing with HTTP. | 5 /// Helpers for dealing with HTTP. |
| 6 library http; | 6 library pub_http; |
|
Bob Nystrom
2012/12/18 19:40:35
Do dotted identifiers work here yet? If not, add a
nweiz
2012/12/19 01:10:21
The analyzer likes it and the tests run, so let's
| |
| 7 | 7 |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:json'; | 9 import 'dart:json'; |
| 10 | 10 |
| 11 // TODO(nweiz): Make this import better. | 11 // TODO(nweiz): Make this import better. |
| 12 import '../../pkg/http/lib/http.dart' as http; | 12 import '../../pkg/http/lib/http.dart' as http; |
| 13 import 'curl_client.dart'; | 13 import 'curl_client.dart'; |
| 14 import 'io.dart'; | 14 import 'io.dart'; |
| 15 import 'log.dart' as log; | 15 import 'log.dart' as log; |
| 16 | 16 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 * Exception thrown when an HTTP operation fails. | 129 * Exception thrown when an HTTP operation fails. |
| 130 */ | 130 */ |
| 131 class PubHttpException implements Exception { | 131 class PubHttpException implements Exception { |
| 132 final http.Response response; | 132 final http.Response response; |
| 133 | 133 |
| 134 const PubHttpException(this.response); | 134 const PubHttpException(this.response); |
| 135 | 135 |
| 136 String toString() => 'HTTP error ${response.statusCode}: ' | 136 String toString() => 'HTTP error ${response.statusCode}: ' |
| 137 '${response.reasonPhrase}'; | 137 '${response.reasonPhrase}'; |
| 138 } | 138 } |
| OLD | NEW |