sending json data uing fetch is empty

Solutions on MaxInterview for sending json data uing fetch is empty by the best coders in the world

showing results for - "sending json data uing fetch is empty"
Simone
23 May 2020
1var myHeaders = new Headers();
2myHeaders.append('Content-Type', 'application/json');
3
4fetch('/contact-form', {
5    method: 'POST',
6    headers: myHeaders,
7    mode: 'cors',
8    cache: 'default',
9    body: JSON.stringify(fields)
10}).then(() => {
11    dispatch(contactFormSubmitSuccess());
12});
13
Yannic
21 Apr 2017
1fetch('/api/v1/users', {  
2    method: 'post',
3    headers: {'Content-Type': 'application/json'},
4    body: JSON.stringify({ "user": {
5      "email" : email,
6      "password" : password
7    }}),
8})
9