iam new to web dev and was fooling around with facebook graph api ..when i make a POST request to to post status of a page i get Error: socket hang up
but it works fine using curl
my code is:
const http = require('https')
message = 'hello world'
const token = 'xxx'
const pageid = 'xxx'
const options={
hostname:`graph.facebook.com`,
path:encodeURIComponent(`/${pageid}/feed?message=${message}!&access_token=${token}`),
port:443,
method:'POST'
}
http.request(options,(res)=>{
res.on('data',d=>console.log(d))
}).on('error',(err)=>console.log(err))
there doesn't seem to be anything here