Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialkaran Badhwar
Web Development Techdegree Graduate 18,135 Pointsapi
What is an API, is Async development is all about Web API's ?
On google as per the API's definition, it is some sort of messenger that takes the request and returns back with the response, but how it is a Web API container that holds the Async code? and how does the browser know that this code will make block the Script, other than pre-defined methods like setInterval or setTimeout, how about some code that requires the wait time, how the JS engine gets that it will block the script?
One more thing how do we pull the API from another site, as we can have different API's how do we get to know that the API is to retrieve data? what I understood is that API creates the connections, so how does a URL pass on the all the info we required, how does it know what we want?
1 Answer
Steven Parker
231,184 PointsIt's better to give the community at least 24 hours to answer a question before tagging anyone in particular. Also, questions like this will sometimes be answered in the course if you continue a few steps further.
Whoever designs the API should provide documentation for others to use it. All API's are a bit different, but a typical way to pass info to an API is through the query string appended to the URL starting with a question mark.
Timers are not the most typical way to implement async access to an API. A much more common way would be to use a mechanism that generates an event or invokes a callback when data is received. This is the case with the AJAX and Fetch operations that this course talks about.
karan Badhwar
Web Development Techdegree Graduate 18,135 PointsHi Steven Parker thankyou for taking out the time and sorry for bothering as well before the completion of 24 hour period
karan Badhwar
Web Development Techdegree Graduate 18,135 Pointskaran Badhwar
Web Development Techdegree Graduate 18,135 PointsHi Steven Parker , by any chance if you are online would you be able to help me with this please.