- REST stands for Representational State Transfer.
- It's an architectural style introduced by _Roy Fielding in 2000_.
- REST principles:
- Uniform Interface: Resources are only accessible as representations and the rules for processing that representation are described through self-descriptive messages.
- Stateless: Every client request to the server is self-contained and subsequent requests do not require information from prior requests.
- Client-Server: A client and server must be present in the architecture.
- Cacheable & Layered System: Caching and other techniques are utilized in order to increase network efficiency.
-
Hypertext Transfer Protocol (HTTP) is a protocol that provides a standardized way for computers to communicate with each other. It has been the foundation for data communication over the internet since 1990 and is integral to understanding how client-server communication functions.
-
Features:
- Connectionless: When a request is sent, the client opens the connection; once a response is received, the client closes the connection. The client and server only maintain a connection during the response and request. Future responses are made on a new connection.
- Stateless: There is no dependency between successive requests.
- Not Sessionless: Utilizing headers and cookies, sessions can be created to allow each HTTP request to share the same context.
- Media Independent: Any type of data can be sent over HTTP as long as both the client and server know how to handle the data format. In our case, we'll use JSON.
-
Elements:
- Universal Resource Identifiers (URIs): An example URI is http://www.example.com/tasks/term=homework. It has certain components:
- Scheme: specifies the protocol used to access the resource, HTTP or HTTPS. In our example http.
- Host: specifies the host that holds the resources. In our example www.example.com.
- Path: specifies the specific resource being requested. In our example, /tasks.
- Query: an optional component, the query string provides information the resource can use for some purpose such as a search parameter. In our example, /term=homework.
- Endpoint to return an image in a ready to visualize form
- Deploying flask application to Heroku and Kubernates using EKS
-
Example usage, install flask in a python 2.7 environment
`conda install https://repo.anaconda.com/pkgs/free/linux-64/flask-0.10-py27_0.tar.bz2`