Skip to content

Commit

Permalink
chore(error-handling): fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
iiio2 committed Oct 9, 2024
1 parent 6e6bd86 commit e17ad7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ If an object or a class with a `.toJSON()` method is passed to the `body` option

For `PUT`, `PATCH`, and `POST` request methods, when a string or object body is set, `ofetch` adds the default `content-type: "application/json"` and `accept: "application/json"` headers (which you can always override).

Additionally, `ofetch` supports binary responses with `Buffer`, `ReadableStream`, `Stream`, and [compatible body types](https://developer.mozilla.org/en-US/docs/Web/API/fetch#body). ofetch will automatically set the `duplex: "half"` option for streaming support!
Additionally, `ofetch` supports binary responses with `Buffer`, `ReadableStream`, `Stream`, and [compatible body types](https://developer.mozilla.org/en-US/docs/Web/API/fetch#body). `ofetch` will automatically set the `duplex: "half"` option for streaming support!

**Example:**

Expand Down Expand Up @@ -281,7 +281,7 @@ await ofetch("/movies", {

## 🍣 Access to Raw Response

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

```js
const response = await ofetch.raw("/sushi");
Expand Down
2 changes: 1 addition & 1 deletion examples/error-handling.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ try {
// Error will be pretty printed
console.error(error);

// This allow us to access the error body
// This allows us to access the error body

Check warning on line 11 in examples/error-handling.mjs

View check run for this annotation

Codecov / codecov/patch

examples/error-handling.mjs#L11

Added line #L11 was not covered by tests
console.log(error.data);
}

0 comments on commit e17ad7b

Please sign in to comment.