'How to call web api in typescript?

I am developing an extension using typescript,and I don't know how to use typescript to call web API, anyone know or can provide an sample to me?



Solution 1:[1]

Typescript is compiled into javascript, in Javascript specifically node environemnt, there are many ways to make an HTTP call to the web API. You can use these libraries:

  1. axios
  2. got
  3. node-fetch

These libraries have type definitions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pranu Pranav