Comments (1)
$fetch
API is intentionally immutable and not allowing headers.
It is a feature by design -- just like standard fetch. You should use explicit wrapper utils that add global settings like headers.
The context for nuxt: it was a mistake in the legacy Nuxt axios module we allowed application-wide mutations.
I try to overwrite the $fetch (nuxt/nuxt#28620) but I really don't like this
You can (just like you can virtually override anything in js like globalThis.Array
) but don't, it is not safe at all.
from ofetch.
Related Issues (20)
- TS2305: Module 'ofetch' has no exported member FetchOptions HOT 1
- Errors in Interceptors are silently handled HOT 1
- How to handle errors body HOT 1
- GraphQL Support HOT 3
- Body in options object in $fetch method from NUXT3 not available in request to server HOT 1
- When using $fetch.raw, clone() cannot be used. HOT 2
- unexpected behavior from `ofetch.raw` and `onResponse` HOT 2
- Add support of TS type annotations on `ofetch.create` HOT 3
- Better Handle Support for Development Certificates HOT 1
- How can ofetch upload files and obtain real-time progress? HOT 1
- define url params using options HOT 2
- i have a request when i abort this request will be a error "signal is aborted without reason" HOT 2
- http2 support tracker HOT 2
- type issue of onResponse's `response._data` HOT 1
- Check if the body should be parsed to handle x-www-form-urlencoded payloads
- stateful fetch client
- $fetch cannot get data correctly within Alipay in IOS
- Bun compatibility
- When using interceptors, how to wait some action before continue to another requests? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofetch.