@@ -25,30 +25,27 @@ export 'src/response.dart';
2525export 'src/streamed_request.dart' ;
2626export 'src/streamed_response.dart' ;
2727
28- /// Sends an HTTP HEAD request with the given headers to the given URL, which
29- /// can be a [Uri] or a [String] .
28+ /// Sends an HTTP HEAD request with the given headers to the given URL.
3029///
3130/// This automatically initializes a new [Client] and closes that client once
3231/// the request is complete. If you're planning on making multiple requests to
3332/// the same server, you should use a single [Client] for all of those requests.
3433///
3534/// For more fine-grained control over the request, use [Request] instead.
36- Future <Response > head (Object url, {Map <String , String >? headers}) =>
35+ Future <Response > head (Uri url, {Map <String , String >? headers}) =>
3736 _withClient ((client) => client.head (url, headers: headers));
3837
39- /// Sends an HTTP GET request with the given headers to the given URL, which can
40- /// be a [Uri] or a [String] .
38+ /// Sends an HTTP GET request with the given headers to the given URL.
4139///
4240/// This automatically initializes a new [Client] and closes that client once
4341/// the request is complete. If you're planning on making multiple requests to
4442/// the same server, you should use a single [Client] for all of those requests.
4543///
4644/// For more fine-grained control over the request, use [Request] instead.
47- Future <Response > get (Object url, {Map <String , String >? headers}) =>
45+ Future <Response > get (Uri url, {Map <String , String >? headers}) =>
4846 _withClient ((client) => client.get (url, headers: headers));
4947
50- /// Sends an HTTP POST request with the given headers and body to the given URL,
51- /// which can be a [Uri] or a [String] .
48+ /// Sends an HTTP POST request with the given headers and body to the given URL.
5249///
5350/// [body] sets the body of the request. It can be a [String] , a [List<int>] or
5451/// a [Map<String, String>] . If it's a String, it's encoded using [encoding] and
@@ -66,13 +63,12 @@ Future<Response> get(Object url, {Map<String, String>? headers}) =>
6663///
6764/// For more fine-grained control over the request, use [Request] or
6865/// [StreamedRequest] instead.
69- Future <Response > post (Object url,
66+ Future <Response > post (Uri url,
7067 {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
7168 _withClient ((client) =>
7269 client.post (url, headers: headers, body: body, encoding: encoding));
7370
74- /// Sends an HTTP PUT request with the given headers and body to the given URL,
75- /// which can be a [Uri] or a [String] .
71+ /// Sends an HTTP PUT request with the given headers and body to the given URL.
7672///
7773/// [body] sets the body of the request. It can be a [String] , a [List<int>] or
7874/// a [Map<String, String>] . If it's a String, it's encoded using [encoding] and
@@ -90,13 +86,13 @@ Future<Response> post(Object url,
9086///
9187/// For more fine-grained control over the request, use [Request] or
9288/// [StreamedRequest] instead.
93- Future <Response > put (Object url,
89+ Future <Response > put (Uri url,
9490 {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
9591 _withClient ((client) =>
9692 client.put (url, headers: headers, body: body, encoding: encoding));
9793
9894/// Sends an HTTP PATCH request with the given headers and body to the given
99- /// URL, which can be a [Uri] or a [String] .
95+ /// URL.
10096///
10197/// [body] sets the body of the request. It can be a [String] , a [List<int>] or
10298/// a [Map<String, String>] . If it's a String, it's encoded using [encoding] and
@@ -114,27 +110,25 @@ Future<Response> put(Object url,
114110///
115111/// For more fine-grained control over the request, use [Request] or
116112/// [StreamedRequest] instead.
117- Future <Response > patch (Object url,
113+ Future <Response > patch (Uri url,
118114 {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
119115 _withClient ((client) =>
120116 client.patch (url, headers: headers, body: body, encoding: encoding));
121117
122- /// Sends an HTTP DELETE request with the given headers to the given URL, which
123- /// can be a [Uri] or a [String] .
118+ /// Sends an HTTP DELETE request with the given headers to the given URL.
124119///
125120/// This automatically initializes a new [Client] and closes that client once
126121/// the request is complete. If you're planning on making multiple requests to
127122/// the same server, you should use a single [Client] for all of those requests.
128123///
129124/// For more fine-grained control over the request, use [Request] instead.
130- Future <Response > delete (Object url,
125+ Future <Response > delete (Uri url,
131126 {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
132127 _withClient ((client) =>
133128 client.delete (url, headers: headers, body: body, encoding: encoding));
134129
135- /// Sends an HTTP GET request with the given headers to the given URL, which can
136- /// be a [Uri] or a [String] , and returns a Future that completes to the body of
137- /// the response as a [String] .
130+ /// Sends an HTTP GET request with the given headers to the given URL and
131+ /// returns a Future that completes to the body of the response as a [String] .
138132///
139133/// The Future will emit a [ClientException] if the response doesn't have a
140134/// success status code.
@@ -145,12 +139,12 @@ Future<Response> delete(Object url,
145139///
146140/// For more fine-grained control over the request and response, use [Request]
147141/// instead.
148- Future <String > read (Object url, {Map <String , String >? headers}) =>
142+ Future <String > read (Uri url, {Map <String , String >? headers}) =>
149143 _withClient ((client) => client.read (url, headers: headers));
150144
151- /// Sends an HTTP GET request with the given headers to the given URL, which can
152- /// be a [Uri] or a [String] , and returns a Future that completes to the body of
153- /// the response as a list of bytes.
145+ /// Sends an HTTP GET request with the given headers to the given URL and
146+ /// returns a Future that completes to the body of the response as a list of
147+ /// bytes.
154148///
155149/// The Future will emit a [ClientException] if the response doesn't have a
156150/// success status code.
@@ -161,7 +155,7 @@ Future<String> read(Object url, {Map<String, String>? headers}) =>
161155///
162156/// For more fine-grained control over the request and response, use [Request]
163157/// instead.
164- Future <Uint8List > readBytes (Object url, {Map <String , String >? headers}) =>
158+ Future <Uint8List > readBytes (Uri url, {Map <String , String >? headers}) =>
165159 _withClient ((client) => client.readBytes (url, headers: headers));
166160
167161Future <T > _withClient <T >(Future <T > Function (Client ) fn) async {
0 commit comments