@@ -30,7 +30,7 @@ export 'src/streamed_response.dart';
30
30
/// the same server, you should use a single [Client] for all of those requests.
31
31
///
32
32
/// For more fine-grained control over the request, use [Request] instead.
33
- Future <Response > head (url, {Map <String , String > headers}) =>
33
+ Future <Response > head (Object url, {Map <String , String >? headers}) =>
34
34
_withClient ((client) => client.head (url, headers: headers));
35
35
36
36
/// Sends an HTTP GET request with the given headers to the given URL, which can
@@ -41,7 +41,7 @@ Future<Response> head(url, {Map<String, String> headers}) =>
41
41
/// the same server, you should use a single [Client] for all of those requests.
42
42
///
43
43
/// For more fine-grained control over the request, use [Request] instead.
44
- Future <Response > get (url, {Map <String , String > headers}) =>
44
+ Future <Response > get (Object url, {Map <String , String >? headers}) =>
45
45
_withClient ((client) => client.get (url, headers: headers));
46
46
47
47
/// Sends an HTTP POST request with the given headers and body to the given URL,
@@ -63,8 +63,8 @@ Future<Response> get(url, {Map<String, String> headers}) =>
63
63
///
64
64
/// For more fine-grained control over the request, use [Request] or
65
65
/// [StreamedRequest] instead.
66
- Future <Response > post (url,
67
- {Map <String , String > headers, body, Encoding encoding}) =>
66
+ Future <Response > post (Object url,
67
+ {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
68
68
_withClient ((client) =>
69
69
client.post (url, headers: headers, body: body, encoding: encoding));
70
70
@@ -87,8 +87,8 @@ Future<Response> post(url,
87
87
///
88
88
/// For more fine-grained control over the request, use [Request] or
89
89
/// [StreamedRequest] instead.
90
- Future <Response > put (url,
91
- {Map <String , String > headers, body, Encoding encoding}) =>
90
+ Future <Response > put (Object url,
91
+ {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
92
92
_withClient ((client) =>
93
93
client.put (url, headers: headers, body: body, encoding: encoding));
94
94
@@ -111,8 +111,8 @@ Future<Response> put(url,
111
111
///
112
112
/// For more fine-grained control over the request, use [Request] or
113
113
/// [StreamedRequest] instead.
114
- Future <Response > patch (url,
115
- {Map <String , String > headers, body, Encoding encoding}) =>
114
+ Future <Response > patch (Object url,
115
+ {Map <String , String >? headers, Object ? body, Encoding ? encoding}) =>
116
116
_withClient ((client) =>
117
117
client.patch (url, headers: headers, body: body, encoding: encoding));
118
118
@@ -124,7 +124,7 @@ Future<Response> patch(url,
124
124
/// the same server, you should use a single [Client] for all of those requests.
125
125
///
126
126
/// For more fine-grained control over the request, use [Request] instead.
127
- Future <Response > delete (url, {Map <String , String > headers}) =>
127
+ Future <Response > delete (Object url, {Map <String , String >? headers}) =>
128
128
_withClient ((client) => client.delete (url, headers: headers));
129
129
130
130
/// Sends an HTTP GET request with the given headers to the given URL, which can
@@ -140,7 +140,7 @@ Future<Response> delete(url, {Map<String, String> headers}) =>
140
140
///
141
141
/// For more fine-grained control over the request and response, use [Request]
142
142
/// instead.
143
- Future <String > read (url, {Map <String , String > headers}) =>
143
+ Future <String > read (Object url, {Map <String , String >? headers}) =>
144
144
_withClient ((client) => client.read (url, headers: headers));
145
145
146
146
/// Sends an HTTP GET request with the given headers to the given URL, which can
@@ -156,7 +156,7 @@ Future<String> read(url, {Map<String, String> headers}) =>
156
156
///
157
157
/// For more fine-grained control over the request and response, use [Request]
158
158
/// instead.
159
- Future <Uint8List > readBytes (url, {Map <String , String > headers}) =>
159
+ Future <Uint8List > readBytes (Object url, {Map <String , String >? headers}) =>
160
160
_withClient ((client) => client.readBytes (url, headers: headers));
161
161
162
162
Future <T > _withClient <T >(Future <T > Function (Client ) fn) async {
0 commit comments