Skip to content

Commit

Permalink
docs: added proper js formatting
Browse files Browse the repository at this point in the history
following #1606 (715516d)
  • Loading branch information
lamweili committed Sep 17, 2022
1 parent 9939810 commit dd6dd8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit dd6dd8c

Please sign in to comment.