Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Get Error

Uncaught (in promise) TypeError: Request constructor: HEAD or GET Request cannot have a body.
What's wrong?


let g = await minos.get("/get", {json:{name:"NAME GET"}}).json();
console.log(g.name);
 

router.get("/get", async function(req, res, next)
{
	res.json({name: "GET WORKS"+req.body.name});
	
	
})
{} get cannot send data with body (the {} part)
req.body.name cannot exist in get.

 
PREVIOUS NEXT
Tagged: #Get #Error
ADD COMMENT
Topic
Name
7+9 =