1//fetch api template
2const fetchData=(inputs)=>{
3fetch('https://example.com/api', {
4 method: 'post',
5 headers: { 'Content-Type': 'application/json' },
6 body: JSON.stringify(inputs)
7 })
8 .then(function(response) {
9 return response.json();
10 })
11 .then(function(data) {
12 ChromeSamples.log(data.whatever);
13 });
14}