下面的代码不起作用并返回 403 forbidden 但相同的 url 提供了正确的响应邮递员工具。
fetch('https://example.com/', {
method: 'POST',
headers: {'Content-Type': 'application/json', },
body:JSON.stringify(sampledata),
}).then(result => console.log('success====:', result))
.catch(error => console.log('error============:', error));