0

What is api

31st Jan 2017, 2:23 PM
qwerty12345
5 Respuestas
+ 4
Specifically, as you tag "web-storage" in your question: Local and session storage handles paired text key/value... but you can store any type of content you want by encoding them in a text format ( as JSON ). Important things about web-storage: - new in html5 - unique access per domain ( as for cookies ) - size limit greater than cookies, but can be navigator/user dependant ( about 5-10MB per origin instead 2KB for cookies ) - contrary to cookies, data cannot be shared/access with/by server through http headers ( but obviously, still possible to use Ajax to communicate ) - data stored in navigator, means one set of value by navigator access ( each navigator on each device ) And for going further, follow the links in this post: https://www.sololearn.com/Discuss/176722/how-can-i-have-the-javascript-input-data-into-sessionstorage
31st Jan 2017, 4:13 PM
visph
visph - avatar
+ 1
An API (Application Programming Interface) is best thought of as a contract provided by one piece of computer software to another. It's important to note that pieces of software can interact with or without an API. For example: Without API: An app finds the current weather in London by opening http://www.weather.com/ and reading the webpage like a human does, interpreting the content. With API: An app finds the current weather in London by sending a message to the weather.com API (in a structured format like JSON). The weather.com API then replies with a structured response. With an API, the exact structure of request and response is documented upfront by weather.com, and is likely to remain constant, regardless of whether the website changes its look and feel for human visitors. Without an API, my app relies on the website never changing its look. If it does, my app may stop working because it can't parse (understand) the webpage anymore. Computers are only as smart as the software you write. So, the example with API is preferable because it's more robust. I know that my app will continue to work with the weather.com API, regardless of whether weather.com changes its web site
31st Jan 2017, 2:29 PM
Alex
Alex - avatar
0
makes your code/app/website work with others like integration facebook.
31st Jan 2017, 2:37 PM
Andre van Rensburg
Andre van Rensburg - avatar
0
It is not something special to html5 or web-storage. It is certainly not a contract provided by one program to another. It is simply an Interface wich can provide internal functionality to external Software. Not bound by any contract. Anybody can ask for something, if it's in the right format and you have access rights it will give you the wished answer. Simple C++ example: int main(int argc, char* argv[]){ cout << argv[1] + argv[2]; } I compile this to a Programm called sum, then i can use sum 12 23 and it will give me the sum 35. THIS IS A API! I could use this in other Software, by calling this Program in Terminal and catching the response. And i would not have to implement my own sum-Method. So Web-Storage API is an Interface for you to use your browsers internal Storage functionality externally.
31st Jan 2017, 5:03 PM
Ali Mzadeh
Ali Mzadeh - avatar
0
Thank you, the posts on here were very helpful
1st Dec 2021, 7:05 PM
Jonathan Strait
Jonathan Strait - avatar