Replies: 3 comments 12 replies
-
I'm currently working on a PR for this. I've been looking at how other popular libraries have done things and am going to follow what they do. Currently following what |
Beta Was this translation helpful? Give feedback.
-
I personally would like to keep this function as simple as possible. It's more like, if you want to fetch something quickly, we already provided out-of-box. For more complex cases, they should use |
Beta Was this translation helpful? Give feedback.
-
As a newcomer, I thought Also, coming from
How can one use |
Beta Was this translation helpful? Give feedback.
-
@wheatjs @antfu @benlesh @isgj
Can we do a little effort to close the
useFetch
functioning? I know we are all very busy with other projects, but this subject is taking more than 10 days to just only define its behavior (we have disparate behaviors on #549, I'm suggesting using raw objects instead fetch ones, others requesting removing the raw object encoding and also the content-type header handling on multipart requests)...I can remove all logic to encode raw objects to build the request body and also remove the content-type header handling and just keep the original logic, only adding the content type when necessary.
The stopper here was the payloadType option since is forcing us to deal with it, but removing the content-type header that handles the issue it goes away.
Problems to be resolved:
fetch
ones: you can see some examples here and here. Raw objects can be used to change the encoding without rewriting the logic: for example, switching betweenapplication/json
andapplication/x-www-form-urlencoded
is just switch thepayloadType
option without rewriting the logic to encode the object while using justfetch
ones we will need to change also the object itself we are sending.responseHandler
andCustomResponseContext
type here and here respectivelly.Beta Was this translation helpful? Give feedback.
All reactions