what is the request payload in jaavascript fetch

Solutions on MaxInterview for what is the request payload in jaavascript fetch by the best coders in the world

showing results for - "what is the request payload in jaavascript fetch"
Philomène
20 May 2016
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(res => res.json())
13.then(console.log)
Giuseppe
22 Aug 2017
1fetch('https://jsonplaceholder.typicode.com/posts/1')
2  .then(res => res.json())
3  .then(console.log)
similar questions