_http: Fix final doc comment issues

Change-Id: Ie1ed719aca9b1f18240b811271ac952818d04c89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218664
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
This commit is contained in:
Kevin Moore
2021-10-29 18:02:10 +00:00
committed by commit-bot@chromium.org
parent 5811541df6
commit 74dea5d1bd
3 changed files with 19 additions and 13 deletions
+8 -5
View File
@@ -1199,7 +1199,7 @@ abstract class HttpResponse implements IOSink {
/// If a body is present, it must be read. Otherwise, it leads to resource
/// leaks. Consider using [HttpClientResponse.drain] if the body is unused.
///
/// ```dart
/// ```dart import:convert
/// var client = HttpClient();
/// try {
/// HttpClientRequest request = await client.get('localhost', 80, '/file.txt');
@@ -1673,7 +1673,8 @@ abstract class HttpClient {
/// encoding used is determined from the "charset" parameter of
/// the "Content-Type" header.
///
/// ```dart
/// ```dart import:convert
/// var client = HttpClient();
/// HttpClientRequest request = await client.get('localhost', 80, '/file.txt');
/// request.headers.contentType =
/// ContentType('application', 'json', charset: 'utf-8');
@@ -1683,6 +1684,7 @@ abstract class HttpClient {
/// If no charset is provided the default of ISO-8859-1 (Latin 1) is used.
///
/// ```dart
/// var client = HttpClient();
/// HttpClientRequest request = await client.get('localhost', 80, '/file.txt');
/// request.headers.add(HttpHeaders.contentTypeHeader, "text/plain");
/// request.write('blåbærgrød'); // Strings written will be ISO-8859-1 encoded
@@ -1783,8 +1785,9 @@ abstract class HttpClientRequest implements IOSink {
/// the request has been aborted
///
/// ```dart import:async
/// HttpClientRequest request = ...
/// request.write();
/// var client = HttpClient();
/// HttpClientRequest request = await client.get('localhost', 80, '/file.txt');
/// request.write('request content');
/// Timer(Duration(seconds: 1), () {
/// request.abort();
/// });
@@ -1804,7 +1807,7 @@ abstract class HttpClientRequest implements IOSink {
/// server. Use [Stream] methods like [`transform`][Stream.transform] and
/// [`join`][Stream.join] to access the data.
///
/// ```dart
/// ```dart import:convert
/// var client = HttpClient();
/// try {
/// HttpClientRequest request = await client.get('localhost', 80, '/file.txt');
+10 -8
View File
@@ -13,20 +13,22 @@ const _asyncRunZoned = runZoned;
/// that construct a mock implementation. The implementation in this base class
/// defaults to the actual [HttpClient] implementation. For example:
///
/// ```dart
/// ```dart import:io
/// // An implementation of the HttpClient interface
/// class MyHttpClient implements HttpClient {
/// ...
/// // An implementation of the HttpClient interface
/// ...
/// MyHttpClient(SecurityContext? c);
///
/// @override
/// noSuchMethod(Invocation invocation) {
/// // your implementation here
/// }
/// }
///
/// main() {
/// void main() {
/// HttpOverrides.runZoned(() {
/// ...
/// // Operations will use MyHttpClient instead of the real HttpClient
/// // implementation whenever HttpClient is used.
/// ...
/// }, createHttpClient: (SecurityContext c) => MyHttpClient(c));
/// }, createHttpClient: (SecurityContext? c) => MyHttpClient(c));
/// }
/// ```
abstract class HttpOverrides {
+1
View File
@@ -3474,6 +3474,7 @@
"script": "out/ReleaseX64/dart-sdk/bin/dart",
"arguments": [
"tools/verify_docs/bin/verify_docs.dart",
"sdk/lib/_http",
"sdk/lib/_internal",
"sdk/lib/cli",
"sdk/lib/convert",