var url = 'Test/SaveReportDetail';
var username = 'example' ;
fetch(url, {
method: 'POST', // or 'PUT'
body: JSON.stringify(username),
headers: {
'Accept': 'application/json; charset=utf-8',
'Content-Type': 'application/json;charset=UTF-8'
}
}).then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));