Skip to content

Commit

Permalink
Merge branch 'feature/[email protected]'
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Dec 18, 2024
2 parents df051c2 + 8ebefe2 commit 2a3c38b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/resource/01-request-adapter/03-xhr.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ const alovaInst = createAlova({
});
```

When you need to access the internal XMLHttpRequest instance, you can get the instance through the `create` callback function.

```javascript
const alovaInst = createAlova({
// ...
requestAdapter: xhrRequestAdapter({
onCreate(xhr) {
// Access xhr instance
// ...
}
})
// ...
});
```

### Request

The XMLHttpRequest adapter provides basic configuration parameters, including `responseType`, `withCredentials`, `mimeType`, `auth`, as follows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ const alovaInst = createAlova({
});
```

当需要访问内部的XMLHttpRequest 实例时,可以通过`create`回调函数获取到实例。

```javascript
const alovaInst = createAlova({
// ...
requestAdapter: xhrRequestAdapter({
onCreate(xhr) {
// 访问xhr实例
// ...
}
})
// ...
});
```

### 请求

XMLHttpRequest 适配器提供了基本的配置参数,包含`responseType``withCredentials``mimeType``auth`,具体如下:
Expand Down

0 comments on commit 2a3c38b

Please sign in to comment.