-1

node.jsサーバーからGoogleのPlaces APIを使用しようとしています

これは私がアクセスしようとしている URL です。

https://maps.googleapis.com/maps/api/place/textsearch/json?query=parkings+in+Madrid,Spain&sensor=true&key=key

サーバーからのリクエストを処理する最良の方法はどれですか?

ありがとう!

4

1 に答える 1

1

https.getまたはを使用しhttps.requestます。

const https = require("https");

https.get("https://maps.googleapis.com/maps/api/place/textsearch/json?query=parkings+in+Madrid,Spain&sensor=true&key=key", function(res) {
  console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
  console.log("Got error: " + e.message);
});
于 2013-01-06T20:09:34.110 に答える