WMATA API Test

node v8.11.1
version: 2.0.0
endpointsharetweet
const got = require('got'); const url = 'https://api.wmata.com/Incidents.svc/json/Incidents'; (async () => { try { const response = await got(url, { headers: { 'api_key': process.env.myApiKey } }); console.log(response.body); //=> '<!doctype html> ...' } catch (error) { console.log(error.response.body); //=> 'Internal server error ...' } })();
Loading…

no comments

    sign in to comment