/*Making http request to the api (Git hub) create request parse responce wrap in a function */ var https = require("https"); var username = 'lynndor'; //CREATING AN OBJECT var options = { host: 'api.github.com', path: ' /users/'+ username +'/repos', method: 'GET' }; var request = https.request(options, function(responce){ var body = '' responce.on("data", function(chunk){ body += chunk.toString('utf8') }); responce.on("end", function(){ console.log("Body", body); }); }); request.end();
I'm trying to create a request to git hub api, the goal is to get a list repository for the user you specify, but I keep getting the above error, please help
Lindokuhle dumisani masilela
source share