Skip to content

Commit

Permalink
docs: add note content to request sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Nov 29, 2024
1 parent b0e7f6d commit fdf3b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/tutorial/02-getting-started/03-basic/03-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ alovaInst.Get('/todo', {
});
```

However, it should be noted that when the request body is `FormData`, it will be considered that you intend to communicate with the server, and in this case, request sharing will not be triggered.

:::warning How to identify the same request

The request method, request url, request header, url parameter, and request body of the method instance are used as unique identifiers. Identical identifiers indicate the same request, rather than comparing the reference address of the method instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ alovaInst.Get('/todo', {
});
```

但需要注意的是,当 request body 是 FormData 时,将会被认为你是有意图和服务端通信的,在这种情况下不会触发请求共享。

:::warning 如何识别相同请求

通过 method 实例的请求方法、请求 url、请求头、url 参数、请求体组合作为唯一标识,标识相同即表示为相同请求,而不是对比 method 实例的引用地址。
Expand Down

0 comments on commit fdf3b5f

Please sign in to comment.