From 2a43cb4130c10feb7cfb8ce964c1a65a7df34dbd Mon Sep 17 00:00:00 2001 From: Arthur <45236453+ArthurMJ96@users.noreply.github.com> Date: Fri, 20 May 2022 11:04:37 +0200 Subject: [PATCH] docs(api): improve `useFetch` docs for body type and additional ohmyfetch options (#4985) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Chopin Co-authored-by: pooya parsa --- docs/content/3.api/1.composables/use-fetch.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content/3.api/1.composables/use-fetch.md b/docs/content/3.api/1.composables/use-fetch.md index cb80894087..1bb036f5a4 100644 --- a/docs/content/3.api/1.composables/use-fetch.md +++ b/docs/content/3.api/1.composables/use-fetch.md @@ -13,6 +13,7 @@ function useFetch( type UseFetchOptions = { method?: string, params?: SearchParams, + body?: RequestInit['body'] | Record headers?: {key: string, value: string}[], baseURL?: string, server?: boolean @@ -33,9 +34,10 @@ type DataT = { ## Params * **Url**: The URL to fetch -* **Options (from [ohmyfetch](https://github.com/unjs/ohmyfetch))**: +* **Options (extends [unjs/ohmyfetch](https://github.com/unjs/ohmyfetch) options & [AsyncDataOptions](/api/composables/use-async-data#params))**: * `method`: Request method * `params`: Query params + * `body`: Request body - automatically stringified (if an object is passed). * `headers`: Request headers * `baseURL`: Base URL for the request * **Options (from `useAsyncData`)**: