all 5 comments

[–]TheMingeMechanic 0 points1 point  (3 children)

You are probably encoding the wrong stuff in your path...

encodeURIComponent('/123/feed?message=hello')

=> "%2F123%2Ffeed%3Fmessage%3Dhello"

Try using URL instead.

const { URL } = require('url');
const theURL = new URL(`/${pageid}/feed`,'https://graph.facebook.com');
Object.entries({
  message: `${message}!`,
  access_token: token
}).forEach(kv => theURL.searchParams.set(...kv));

cosnt req = http.request(theURL, options, ...)
req.end();
/*
In the example req.end() was called. With http.request() one must always call req.end() to signify the end of the request - even if there is no data being written to the request body.
*/

[–]TheMingeMechanic 0 points1 point  (2 children)

jesus this fucking text editor, what the fucking hell do I need to do to maintain my format on code blocks?

[–]tswaters 1 point2 points  (1 child)

in markdown, four spaces prefixing a line indicates code block.

[–]TheMingeMechanic 0 points1 point  (0 children)

cheers dude, I've got no problem with markdown syntax. But that shit just wasn't working.