skip to Main Content

Javascript – Problem In Get Method of API during Response.JSON,

var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "userId": 1 }); var requestOptions = { method: 'GET', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://mcqapi.onrender.com/api/dashboard", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error)); I…

VIEW QUESTION

Javascript – TypeError: Cannot read properties of undefined (reading 'headers') at eval Next js

Hi i am having this error in next js TypeError: Cannot read properties of undefined (reading 'headers') at eval (webpack-internal:///(sc_server)/./node_modules/next/dist/server/future/route-modules/app-route/module.js:254:61) a sample of code snippet newUser .save() .then(() => NextResponse.json({ msg: "Successfuly created new User: " + newUser ,status:200}) )…

VIEW QUESTION
Back To Top
Search