MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / handleClick

Function handleClick

Video 124/api-routes/app/page.js:5–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4export default function Home() {
5 const handleClick = async () => {
6 let data = {
7 name: "Shubham",
8 role: "Coder"
9 }
10 let a = await fetch("/api/add", {
11 method: "POST", headers: {
12 "Content-Type": "application/json",
13 },
14 body: JSON.stringify(data),
15 })
16 let res = await a.json()
17 console.log(res)
18 }
19
20 return (
21 <div>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected