1const url ='https://example.com';
2const headers = {
3 "Content-Type": "application/json",
4 "client_id": "1001125",
5 "client_secret": "876JHG76UKFJYGVHf867rFUTFGHCJ8JHV"
6}
7const data = {
8 "name": "Wade Wilson",
9 "occupation": "Murderer",
10 "age": "30 (forever)"
11}
12
13fetch(url, { method: 'POST', headers: headers, body: data})
14 .then((res) => {
15 return res.json()
16})
17.then((json) => {
18 // Do something with the returned data.
19 console.log(json);
20
21});