1fetch('https://jsonplaceholder.typicode.com/posts', {
2 method: 'POST',
3 body: JSON.stringify({
4 title: 'foo',
5 body: 'bar',
6 userId: 1,
7 }),
8 headers: {
9 'Content-type': 'application/json; charset=UTF-8',
10 },
11})
12 .then((response) => response.json())
13 .then((json) => console.log(json));