You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22
Original file line number
Diff line number
Diff line change
@@ -661,6 +661,7 @@ if (response.ok) {
661
661
Acceptsalltheoptionsfromnative [fetch](http://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters) in the desktop browsers, or [`node-fetch`](https://github.com/node-fetch/node-fetch#options) in node.js. Additionally you can specify:
Baseofa [URL](http://developer.mozilla.org/en-US/docs/Web/API/URL), use it only if you want to specify relative url inside [resource](#resource-string). By default equals to `location.origin` if available. Not merged when you [extend](#extend) an instance. Most of the time use [resource](#resource-string) option instead.
711
+
712
+
```ts
713
+
// send a request to `newURL('/posts', location.origin)` if possible
714
+
await YF.get('/posts')
715
+
716
+
// send a request to `https://jsonplaceholder.typicode.com/posts`
Request headers, the same as in [Fetch](http://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), except multiple `headers` will merge when you [extend](#extend) an instance.
0 commit comments