Total: Rp

var http = require("https"); var options = { "method": "GET", "hostname": "api.rajaongkir.com", "port": null, "path": "/starter/province?id=12", "headers": { "key": "11f748c4f2f56e4b668baa18488a9ed4" } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();