Answers for "making axios call in typescri[t"

4

axios typescript

axios.request<ServerData>({
  url: 'https://example.com/path/to/data',
  transformResponse: (r: ServerResponse) => r.data
}).then((response) => {
  // `response` is of type `AxiosResponse<ServerData>`
  const { data } = response
  // `data` is of type ServerData, correctly inferred
})
Posted by: Guest on February-03-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language