Skip to content

Commit ba03ec1

Browse files
authored
Delete some copy/paste docs (#444)
These docs are copied from the `Client` class. When a method is an `@override` and has no doc, dartdoc will already duplicate the docs from the overridden method - there is no need to copy the docs manually.
1 parent 7b55a2c commit ba03ec1

File tree

1 file changed

+0
-89
lines changed

1 file changed

+0
-89
lines changed

lib/src/base_client.dart

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -18,124 +18,39 @@ import 'streamed_response.dart';
1818
/// This is a mixin-style class; subclasses only need to implement [send] and
1919
/// maybe [close], and then they get various convenience methods for free.
2020
abstract class BaseClient implements Client {
21-
/// Sends an HTTP HEAD request with the given headers to the given URL, which
22-
/// can be a [Uri] or a [String].
23-
///
24-
/// For more fine-grained control over the request, use [send] instead.
2521
@override
2622
Future<Response> head(url, {Map<String, String> headers}) =>
2723
_sendUnstreamed('HEAD', url, headers);
2824

29-
/// Sends an HTTP GET request with the given headers to the given URL, which
30-
/// can be a [Uri] or a [String].
31-
///
32-
/// For more fine-grained control over the request, use [send] instead.
3325
@override
3426
Future<Response> get(url, {Map<String, String> headers}) =>
3527
_sendUnstreamed('GET', url, headers);
3628

37-
/// Sends an HTTP POST request with the given headers and body to the given
38-
/// URL, which can be a [Uri] or a [String].
39-
///
40-
/// [body] sets the body of the request. It can be a [String], a [List<int>]
41-
/// or a [Map<String, String>]. If it's a String, it's encoded using
42-
/// [encoding] and used as the body of the request. The content-type of the
43-
/// request will default to "text/plain".
44-
///
45-
/// If [body] is a List, it's used as a list of bytes for the body of the
46-
/// request.
47-
///
48-
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
49-
/// content-type of the request will be set to
50-
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
51-
///
52-
/// [encoding] defaults to UTF-8.
53-
///
54-
/// For more fine-grained control over the request, use [send] instead.
5529
@override
5630
Future<Response> post(url,
5731
{Map<String, String> headers, body, Encoding encoding}) =>
5832
_sendUnstreamed('POST', url, headers, body, encoding);
5933

60-
/// Sends an HTTP PUT request with the given headers and body to the given
61-
/// URL, which can be a [Uri] or a [String].
62-
///
63-
/// [body] sets the body of the request. It can be a [String], a [List<int>]
64-
/// or a [Map<String, String>]. If it's a String, it's encoded using
65-
/// [encoding] and used as the body of the request. The content-type of the
66-
/// request will default to "text/plain".
67-
///
68-
/// If [body] is a List, it's used as a list of bytes for the body of the
69-
/// request.
70-
///
71-
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
72-
/// content-type of the request will be set to
73-
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
74-
///
75-
/// [encoding] defaults to UTF-8.
76-
///
77-
/// For more fine-grained control over the request, use [send] instead.
7834
@override
7935
Future<Response> put(url,
8036
{Map<String, String> headers, body, Encoding encoding}) =>
8137
_sendUnstreamed('PUT', url, headers, body, encoding);
8238

83-
/// Sends an HTTP PATCH request with the given headers and body to the given
84-
/// URL, which can be a [Uri] or a [String].
85-
///
86-
/// [body] sets the body of the request. It can be a [String], a [List<int>]
87-
/// or a [Map<String, String>]. If it's a String, it's encoded using
88-
/// [encoding] and used as the body of the request. The content-type of the
89-
/// request will default to "text/plain".
90-
///
91-
/// If [body] is a List, it's used as a list of bytes for the body of the
92-
/// request.
93-
///
94-
/// If [body] is a Map, it's encoded as form fields using [encoding]. The
95-
/// content-type of the request will be set to
96-
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
97-
///
98-
/// [encoding] defaults to UTF-8.
99-
///
100-
/// For more fine-grained control over the request, use [send] instead.
10139
@override
10240
Future<Response> patch(url,
10341
{Map<String, String> headers, body, Encoding encoding}) =>
10442
_sendUnstreamed('PATCH', url, headers, body, encoding);
10543

106-
/// Sends an HTTP DELETE request with the given headers to the given URL,
107-
/// which can be a [Uri] or a [String].
108-
///
109-
/// For more fine-grained control over the request, use [send] instead.
11044
@override
11145
Future<Response> delete(url, {Map<String, String> headers}) =>
11246
_sendUnstreamed('DELETE', url, headers);
113-
114-
/// Sends an HTTP GET request with the given headers to the given URL, which
115-
/// can be a [Uri] or a [String], and returns a Future that completes to the
116-
/// body of the response as a String.
117-
///
118-
/// The Future will emit a [ClientException] if the response doesn't have a
119-
/// success status code.
120-
///
121-
/// For more fine-grained control over the request and response, use [send] or
122-
/// [get] instead.
12347
@override
12448
Future<String> read(url, {Map<String, String> headers}) async {
12549
final response = await get(url, headers: headers);
12650
_checkResponseSuccess(url, response);
12751
return response.body;
12852
}
12953

130-
/// Sends an HTTP GET request with the given headers to the given URL, which
131-
/// can be a [Uri] or a [String], and returns a Future that completes to the
132-
/// body of the response as a list of bytes.
133-
///
134-
/// The Future will emit an [ClientException] if the response doesn't have a
135-
/// success status code.
136-
///
137-
/// For more fine-grained control over the request and response, use [send] or
138-
/// [get] instead.
13954
@override
14055
Future<Uint8List> readBytes(url, {Map<String, String> headers}) async {
14156
final response = await get(url, headers: headers);
@@ -186,10 +101,6 @@ abstract class BaseClient implements Client {
186101
throw ClientException('$message.', _fromUriOrString(url));
187102
}
188103

189-
/// Closes the client and cleans up any resources associated with it.
190-
///
191-
/// It's important to close each client when it's done being used; failing to
192-
/// do so can cause the Dart process to hang.
193104
@override
194105
void close() {}
195106
}

0 commit comments

Comments
 (0)