| Index: pkg/http/lib/http.dart
|
| diff --git a/pkg/http/lib/http.dart b/pkg/http/lib/http.dart
|
| index 67c56496079297bc2449522e8983ec6200d98b14..d93a1a53512cc8e3401a7dec104f6993c45a0fbd 100644
|
| --- a/pkg/http/lib/http.dart
|
| +++ b/pkg/http/lib/http.dart
|
| @@ -3,68 +3,6 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| /// A composable, [Future]-based library for making HTTP requests.
|
| -///
|
| -/// ## Installing ##
|
| -///
|
| -/// Use [pub][] to install this package. Add the following to your
|
| -/// `pubspec.yaml` file.
|
| -///
|
| -/// dependencies:
|
| -/// http: any
|
| -///
|
| -/// Then run `pub install`.
|
| -///
|
| -/// For more information, see the
|
| -/// [http package on pub.dartlang.org](http://pub.dartlang.org/packages/http).
|
| -///
|
| -/// The easiest way to use this library is via the top-level functions. They
|
| -/// allow you to make individual HTTP requests with minimal hassle:
|
| -///
|
| -/// import 'package:http/http.dart' as http;
|
| -///
|
| -/// var url = "http://example.com/whatsit/create";
|
| -/// http.post(url, body: {"name": "doodle", "color": "blue"})
|
| -/// .then((response) {
|
| -/// print("Response status: ${response.statusCode}");
|
| -/// print("Response body: ${response.body}");
|
| -/// });
|
| -///
|
| -/// http.read("http://example.com/foobar.txt").then(print);
|
| -///
|
| -/// If you're making multiple requests to the same server, you can keep open a
|
| -/// persistent connection by using a [Client] rather than making one-off
|
| -/// requests. If you do this, make sure to close the client when you're done:
|
| -///
|
| -/// var client = new http.Client();
|
| -/// client.post(
|
| -/// "http://example.com/whatsit/create",
|
| -/// body: {"name": "doodle", "color": "blue"})
|
| -/// .then((response) => client.get(response.bodyFields['uri']))
|
| -/// .then((response) => print(response.body))
|
| -/// .whenComplete(client.close);
|
| -///
|
| -/// You can also exert more fine-grained control over your requests and
|
| -/// responses by creating [Request] or [StreamedRequest] objects yourself and
|
| -/// passing them to [Client.send].
|
| -///
|
| -/// This package is designed to be composable. This makes it easy for external
|
| -/// libraries to work with one another to add behavior to it. Libraries wishing
|
| -/// to add behavior should create a subclass of [BaseClient] that wraps another
|
| -/// [Client] and adds the desired behavior:
|
| -///
|
| -/// class UserAgentClient extends http.BaseClient {
|
| -/// final String userAgent;
|
| -/// final http.Client _inner;
|
| -///
|
| -/// UserAgentClient(this.userAgent, this._inner);
|
| -///
|
| -/// Future<StreamedResponse> send(BaseRequest request) {
|
| -/// request.headers['user-agent'] = userAgent;
|
| -/// return _inner.send(request);
|
| -/// }
|
| -/// }
|
| -///
|
| -/// [pub]: http://pub.dartlang.org
|
| library http;
|
|
|
| import 'dart:async';
|
|
|