Moritz Walter
Moritz Walter
NNuxt
Created by Moritz Walter on 3/29/2024 in #❓・help
HTTP-Statuscode on useFetch()
nvm "ignoreResponseError"
9 replies
NNuxt
Created by Moritz Walter on 3/29/2024 in #❓・help
HTTP-Statuscode on useFetch()
works so far, thank you. How do I call up the status code for a 4xx? it throws an exception.
9 replies
NNuxt
Created by Moritz Walter on 3/29/2024 in #❓・help
HTTP-Statuscode on useFetch()
const apiRequest: any = await $fetch("/api" + url, {
method: httpMethod,
headers: {
...headers,
'Content-Type': 'application/json',
},
body: httpMethod != 'GET' ? JSON.stringify(request) : undefined,
params: httpMethod == 'GET' ? request : {},
});
const apiRequest: any = await $fetch("/api" + url, {
method: httpMethod,
headers: {
...headers,
'Content-Type': 'application/json',
},
body: httpMethod != 'GET' ? JSON.stringify(request) : undefined,
params: httpMethod == 'GET' ? request : {},
});
i have made a function that calls this up, how do i do it there?
9 replies
NNuxt
Created by Moritz Walter on 3/29/2024 in #❓・help
HTTP-Statuscode on useFetch()
I don't know if it's me, but when I make myself a routeRules
routeRules: {
'/api/**': { proxy: {to: 'https://api.domain.de/api/**'} }
},
routeRules: {
'/api/**': { proxy: {to: 'https://api.domain.de/api/**'} }
},
then i get "ECONNREFUSED" in the server-console browser console works without problems make the requests with axois, for the statuscode
9 replies
NNuxt
Created by Moritz Walter on 3/29/2024 in #❓・help
HTTP-Statuscode on useFetch()
I almost thought so
9 replies