From dd6dd8ccc2bcc521040503ca412c22349e9a195d Mon Sep 17 00:00:00 2001 From: Lam Wei Li Date: Sun, 18 Sep 2022 01:26:15 +0800 Subject: [PATCH] docs: added proper js formatting following #1606 (715516d8d32cf742495657efa9c88043d23ead37) --- docs/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/index.md b/docs/index.md index fc7dc37fa..87bbc31ac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -97,10 +97,12 @@ The HTTP method defaults to __GET__, so if you wish, the following is valid: To make a request using HTTP/2 protocol only (with no HTTP/1.x fallback), use the `.http2()` method. Currently we do not have auto-detection of HTTP/2-capable servers. This feature is experimental. +```javascript const request = require('superagent'); const res = await request .get('https://example.com/h2') .http2(); +``` ## Setting header fields