_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>
diff --git a/sdk/lib/_http/http.dart b/sdk/lib/_http/http.dart
index 84cfbdf..b63102a 100644
--- a/sdk/lib/_http/http.dart
+++ b/sdk/lib/_http/http.dart
@@ -1199,7 +1199,7 @@
/// 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 @@
/// 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 @@
/// 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 @@
/// 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 @@
/// 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');
diff --git a/sdk/lib/_http/overrides.dart b/sdk/lib/_http/overrides.dart
index db464f8..021a978 100644
--- a/sdk/lib/_http/overrides.dart
+++ b/sdk/lib/_http/overrides.dart
@@ -13,20 +13,22 @@
/// 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 {
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index 448629c..5a1286d 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -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",