Closed pi0 closed 4 years ago
Hello,
This is my current api set up using axios.
I have a centralized method, which spects the HTTP method, URL, Params and the data:
async Execute (method: any, resource: any, params: any, data: any)
So all my api calls, just send de needed data, like this:
Ejecutar (data: any, direccion: any) { return this.Execute('post', direccion,'', data); }
Is there a way to acomplish this by now using @nuxt/http?
@warheartvik You have to create a Nuxt plugin. Please see docs: https://http.nuxtjs.org/guide/advanced.html#create-new-instance-based-on-defaults
Advanced use case. Inside a plugin create a new instance for multi baseURL or custom headers support.
plugins/http.js