export default async function requestData(service, json, onResponseFunction) {
json.service = service
const { data } = await useFetch('http://192.168.0.11:8002/example', {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(json),
method: "POST",
lazy: false,
server: true,
onResponse({ request, response, options }) {
console.log("here")
onResponseFunction(response._data)
console.log(response._data)
}
})
return data
}
export default async function requestData(service, json, onResponseFunction) {
json.service = service
const { data } = await useFetch('http://192.168.0.11:8002/example', {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(json),
method: "POST",
lazy: false,
server: true,
onResponse({ request, response, options }) {
console.log("here")
onResponseFunction(response._data)
console.log(response._data)
}
})
return data
}