Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: pkg/http/lib/http.dart

Issue 11299028: Move CurlClient to Pub so that it can access resources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/http/lib/src/curl_client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// A composable, [Future]-based library for making HTTP requests. 5 /// A composable, [Future]-based library for making HTTP requests.
6 /// 6 ///
7 /// The easiest way to use this library is via the top-level functions. They 7 /// The easiest way to use this library is via the top-level functions. They
8 /// allow you to make individual HTTP requests with minimal hassle: 8 /// allow you to make individual HTTP requests with minimal hassle:
9 /// 9 ///
10 /// import 'package:http/http.dart' as http; 10 /// import 'package:http/http.dart' as http;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 import 'dart:scalarlist'; 59 import 'dart:scalarlist';
60 import 'dart:uri'; 60 import 'dart:uri';
61 61
62 import 'src/client.dart'; 62 import 'src/client.dart';
63 import 'src/response.dart'; 63 import 'src/response.dart';
64 64
65 export 'src/base_client.dart'; 65 export 'src/base_client.dart';
66 export 'src/base_request.dart'; 66 export 'src/base_request.dart';
67 export 'src/base_response.dart'; 67 export 'src/base_response.dart';
68 export 'src/curl_client.dart';
69 export 'src/client.dart'; 68 export 'src/client.dart';
70 export 'src/multipart_file.dart'; 69 export 'src/multipart_file.dart';
71 export 'src/multipart_request.dart'; 70 export 'src/multipart_request.dart';
72 export 'src/request.dart'; 71 export 'src/request.dart';
73 export 'src/response.dart'; 72 export 'src/response.dart';
74 export 'src/streamed_request.dart'; 73 export 'src/streamed_request.dart';
75 export 'src/streamed_response.dart'; 74 export 'src/streamed_response.dart';
76 75
77 /// Sends an HTTP HEAD request with the given headers to the given URL, which 76 /// Sends an HTTP HEAD request with the given headers to the given URL, which
78 /// can be a [Uri] or a [String]. 77 /// can be a [Uri] or a [String].
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 /// instead. 167 /// instead.
169 Future<Uint8List> readBytes(url, {Map<String, String> headers}) => 168 Future<Uint8List> readBytes(url, {Map<String, String> headers}) =>
170 _withClient((client) => client.readBytes(url, headers: headers)); 169 _withClient((client) => client.readBytes(url, headers: headers));
171 170
172 Future _withClient(Future fn(Client)) { 171 Future _withClient(Future fn(Client)) {
173 var client = new Client(); 172 var client = new Client();
174 var future = fn(client); 173 var future = fn(client);
175 future.onComplete((_) => client.close()); 174 future.onComplete((_) => client.close());
176 return future; 175 return future;
177 } 176 }
OLDNEW
« no previous file with comments | « no previous file | pkg/http/lib/src/curl_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698