I use Fetch in ReactJs to send a request to api Moleculer like this :
var data ={
'ordername' : 'PUG',
'receivername' : 'AnSama'
}
fetch(url,{
method: 'POST',
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body : data
})
.then(res => {return res.json()})
.then(
(result) => {
alert(JSON.stringify(result));
},
(error) => {
alert('error');
}
)
Then, I want to get body of request in Moleculer (Framework of NodeJS). How can i do?