简体   繁体   中英

Can't request GET in some API on ALEXA

I'm having trouble on requesting some API, when I write on my backend code (lambda) for Alexa

const request = require('sync-request');

var url = 'https://servicodados.ibge.gov.br/api/v1/projecoes/populacao';


var response = request('GET', url);

it works perfectly fine for others APIs, or on my local IDE.

I would definitely suggest you using async request when using an external API. I suggest you take a look at this or this or this .

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM