Skip to content

Commit

Permalink
docs: add agent option usage (#173)
Browse files Browse the repository at this point in the history
* docs: add agent option usage

* docs: typo

* docs: modify format

* docs: add line break

Co-authored-by: Nozomu Ikuta <16436160+NozomuIkuta@users.noreply.github.com>
  • Loading branch information
yuyinws and NozomuIkuta committed Jan 12, 2023
1 parent eb2d4ac commit 93d07fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ await ofetch('/movies', {
})
```

## 💡 Adding HTTP(S) Agent

If you need use HTTP(S) Agent, can add `agent` option with `https-proxy-agent`:

```js
import { HttpsProxyAgent } from "https-proxy-agent";

await ofetch('/api', {
agent: new HttpsProxyAgent('http://example.com')
})
```

## 🍣 Access to Raw Response

If you need to access raw response (for headers, etc), can use `ofetch.raw`:
Expand Down

0 comments on commit 93d07fe

Please sign in to comment.