I want to create a post request and send data from a form on my wix site to my nodejs server which serves data to other application. I have tried:
import {fetch} from ‘wix-fetch’;
let fetchopt = {
method: ‘post’,
body: JSON.stringify({
message: ‘hello world’
})
};
export function getTestInfo(info){
const url = ‘http://mywebsite.com:3000/test’;
console.log(info);
return fetch(url, fetchopt)
.then(response => response.json());
}
which works but no data gets send to my server. Is there something I am doing wrong?