Answers for "GET request in hackerrank"

0

GET request in hackerrank

var http = require("http");

http.get('URL', (res) => {
res.setEncoding("utf8");
  let body = "";
  res.on("data", data => {
    body += data;
  });
  res.on("end", () => {
    body = JSON.parse(body);
    console.log(body);
  });
});
Posted by: Guest on September-30-2020

Browse Popular Code Answers by Language