Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Sending An AJAX Request Using Ky

/*index.ejs*/
window.onload = async function(){
	const json = await ky.post('/test', {json:{x:"XXXXXXXXXXX"}}).json();

	console.log(json.x);
 
}

/*routes/index.js*/

router.post("/test", async function(req, res, next)
{
	res.json({x:req.body.x});
	
	
})
 
PREVIOUS NEXT
Tagged: #Sending #An #AJAX #Request #Using #Ky
ADD COMMENT
Topic
Name
8+5 =