Http Request in TypeScript

I would suggest using https://github.com/node-fetch/node-fetch

import fetch from 'node-fetch';

const response = await fetch('https://api.github.com/users/github');
const data = await response.json();

console.log(data);

For POST request:

import fetch from 'node-fetch';

const response = await fetch('https://bin.org/post', {method: 'POST', body: 'a=1'});
const data = await response.json();

console.log(data);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)