Vue js Axios and JS

Sumanta Mukhopadhyay
1 min readJun 20, 2020

--

We in the era of javascript often get confused about how to work with javascript in an efficient way as per use case and which framework to choose on.

There are many frameworks and solutions for a type of problem. Let’s say in Vue js we often use AXIOS for API calls, but if we know our basics what it is its just a way of requesting something to the server although Axios is a library built on top of JS which handles this request just a way to make calls.

Vue is a great framework to learn with its easiness and the way its constructed

axios .get(‘https://api.coindesk.com/v1/bpi/currentprice.json') .then(
response => (this.info = response))

Above is the request in Axios style.

var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", "https://api.coindesk.com/v1/bpi/currentprice.json", false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;

This above is the way we do in core-js.

So what we understood the way of doing in both js and Axios way.

--

--

Sumanta Mukhopadhyay
Sumanta Mukhopadhyay

No responses yet