APIs - paper 2 Flashcards
what are APIs
an application programming interface is a set of functions and protocols that clients can use
- a server - side web API is a set of web services or web resources to enable programmers to build web applications
- mashups are multiple APIs
limits of HTTP communication
- client has to request data from the server
- if too much time passes between between establishing a socket connection between client and web server, the server drops the connection to conserve its resources, and returns an error message
web CRUD applications
NAME → HTTP request method → SQL command
Create → POST → INSERT
Retrieve → GET → SELECT
Update → PUT → UPDATE
Delete → DELETE → DELETE
what is REST
Representational State Transfer is an architectural style which determines how systems communicate with each other
- typically REST uses HTTP request methods to interact with online databases
examples of APIs
JSON - similar to python dictionary
XML - similar format to html files
advantages of JSON
- more compact so requires less storage, so quicker to transmit and process
- easier to read, write, and maintain
- data clearly defined as objects
disadvantages of JSON
- only works with a limited range of data types
advantages of XML
- any data type allowed, so more flexible
disadvantages of XML
expensive use of tags makes it hard to follow
describe what thin- client computing is
- processing is carried out on a server