paint-brush
Making HTTP Requests With Axios in TypeScriptby@rzhelieznov
2,655 reads
2,655 reads

Making HTTP Requests With Axios in TypeScript

by Roman10mOctober 18th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A couple of days ago in my current working project, we decided to rewrite our simple fetch service to a more powerful solution with the ability to cancel requests which were sent previously. We decided to use `axios` library and `TypeScript` as everybody has experience with it previously, and it provides a solution for request canceling based on Promises. It’s already working but will be extended in nearly future. All our services in the current project is a class-based, so we need to create a class `AxiosService` It will have 2 fields: instance which has a type 'AxiosInstance' and cancelTokenStatic.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Making HTTP Requests With Axios in TypeScript
Roman HackerNoon profile picture
Roman

Roman

@rzhelieznov

Javascript and React fan. Also love reading, traveling, pc gaming :)

Learn More
LEARN MORE ABOUT @RZHELIEZNOV'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Roman HackerNoon profile picture
Roman@rzhelieznov
Javascript and React fan. Also love reading, traveling, pc gaming :)

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite