Returning data from Axios API

前端 未结 8 1338
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 11:52

I am trying to use a Node.JS application to make and receive API requests. It does a get request to another server using Axios with data it receives from an API call it rece

8条回答
  •  清歌不尽
    2020-12-07 12:43

    You can use Async - Await:

    async function axiosTest() {
      const response = await axios.get(url);
      const data = await response.json();  
    }
    

提交回复
热议问题