DEV Community

Vishnu Priya S
Vishnu Priya S

Posted on

API, Promise

API - Application Programming Interface which is used to communicate between two software over the internet.

API Calling

        fetch(url)
            .then((res) => res.json())
            .then((data)
Enter fullscreen mode Exit fullscreen mode

here the fetch is fetching API url and convert the data into json

->JSON(Javascript Object Notation) - transmitting data between a server and a web application, text based and human readable format.

PROMISE

It act as an asynchronous result operations like success, rejected.
-> if the condition is success(.then)
-> if the cond is rejected(.catch)

Top comments (0)