使用js手动post数据
(async () => {
const rawResponse = await fetch('https://httpbin.org/post', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({a: 1, b: 'Textual content'})
});
// const content = await rawResponse.json();
const content = await rawResponse.text();
console.log(content);
})();
reference
Updated: 2023-02-19 23:29
Created: 2023-02-17 20:00