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 pub.http; | |
7 | |
8 import 'dart:async'; | 6 import 'dart:async'; |
9 import 'dart:convert'; | 7 import 'dart:convert'; |
10 import 'dart:io'; | 8 import 'dart:io'; |
11 | 9 |
12 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
13 import 'package:http_throttle/http_throttle.dart'; | 11 import 'package:http_throttle/http_throttle.dart'; |
14 import 'package:stack_trace/stack_trace.dart'; | 12 import 'package:stack_trace/stack_trace.dart'; |
15 | 13 |
16 import 'log.dart' as log; | 14 import 'log.dart' as log; |
17 import 'oauth2.dart' as oauth2; | 15 import 'oauth2.dart' as oauth2; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 227 |
230 /// Exception thrown when an HTTP operation fails. | 228 /// Exception thrown when an HTTP operation fails. |
231 class PubHttpException implements Exception { | 229 class PubHttpException implements Exception { |
232 final http.Response response; | 230 final http.Response response; |
233 | 231 |
234 const PubHttpException(this.response); | 232 const PubHttpException(this.response); |
235 | 233 |
236 String toString() => 'HTTP error ${response.statusCode}: ' | 234 String toString() => 'HTTP error ${response.statusCode}: ' |
237 '${response.reasonPhrase}'; | 235 '${response.reasonPhrase}'; |
238 } | 236 } |
OLD | NEW |