我正在使用Google Places API构建Alexa技能。我得到了响应,一切都很好,JSON数组中最多有20个对象,但我找不到图像的URL。例如。通过将此URL发送到API(密钥隐藏,请替换):
https://maps.googleapis.com/maps/api/place/photo?key=XXX&photoreference=CmRaAAAAnqOWtjVAhP5ExRrR34oklTIR9Z1ILGKl2N4JkfZYWbqJeIKQq_NuBDR5eQx20_UOQvfFwzuaEJIOH-mNjVQwLPLl_1zSANqmNkF0MUiSuDpz0deW1PGzVJeYdKHROLB3EhCkDZjsjed-Z5f63e5p5-E7GhRihV90sb8Ozj3wU2fdzlsbtfFr9Q&maxwidth=720&maxheight=480
我正在获取图像并跟随标题:
Access-Control-Allow-Origin → *
Access-Control-Expose-Headers → Content-Length
Alt-Svc →quic=":443"; ma=2592000; v="39,38,37,35"
Cache-Control →private, max-age=86400, no-transform
Content-Disposition → inline;filename="2017-08-26.jpg"
Content-Length →102419
Content-Type → image/jpeg
Date → Sun, 15 Oct 2017 19:11:44 GMT
ETag → "vac67" Expires → Fri, 01 Jan 1990 00:00:00 GMT
Server → fife
Vary → Origin
X-Content-Type-Options → nosniff
X-XSS-Protection → 1;mode=block
监控网络,我发现有两个请求:
第二个请求是状态" 200"并在"请求URL"我可以看到图片的真实网址:
https://lh3.googleusercontent.com/p/AF1QipMHPAf26S0Ei4EmUuBlLe131dVLDeYQCoiotHgc=s1600-w720-h480
现在,我如何通过NodeJS获取此URL?