Sources:
1. https://www.geeksforgeeks.org/web-development/
2. https://frontendmasters.com/guides/front-end-handbook/2018/what-is-a-FD.html
For this blog I chose For this blog I chose https://restfulapi.net blog for its well descriptions of terms about Representational State Transfer and how it works. REST was coined by Roy Fielding in 2000. It is an architecture style for designing loosely coupled applications over the network, that is often used in the development of web services.
An API (Application Programming Interface) is a set of definitions and protocols for building and integrating application software. It’s the glue between an information provider and information user or a gateway between clients and resources on the web. Clients are users who want to access information from the web, while resources are information that different applications such as backend services provide to their clients. It could be presented in different format such as multimedia, images, videos, text, numbers or any other data type.
When a user makes a request via rest api, it transfers a representation of the state of the resource to the requester. The representation comes in several formats via HTTP: JSON (JavaScript Object Notation), HTML, XML, XLT, Python or plain text. JSON is the most common format used due to its well readability by humans.
1Headers and parameters are also important in the HTTP methods of a Restful API HTTP request as they contain important identifier information to the request’s metadata, authorization, uniform resource identifier (URI), caching, cookies etc.
2A REST api requires requests to contain components such as Unique resource identifiers, methods, HTTP headers, data and parameters. Some methods include GET, POST, PUT, DELETE.
GET is used by clients to access resources that are located at a specified URL (Uniform Resource Locator)
POST is used by clients to send data to the server.
PUT is used by clients to update existing resources on the server.
DELETE is used to request to remove resources from the server.
HTTP Headers display the http method request or response that passes additional context and metadata about the request or response.
Data
Information that is passed into POST, PUT and other HTTP methods
Parameters in a request include path to specify URL, details, information about the resource.
3Below are 6 architectural constraints which make any web service a truly restful api:
1. Uniform interface :
2. Client-server : Client applications and server applications much st be able to evolve separately without any dependency on each other.
3. Stateless : The server will not store anything about the latest HTTP request the client made.
4. Cacheable : For performance improvement, data can be temporarily be stored on client side
5. Layered system : Data can be stored on server A, authentication on server B and accessed via server A
6. Code on demand : Data can be XML or JSON format or executable code to support part of the application
Sources
1. https://aws.amazon.com/what-is/restful-api/ accessed on 12/2/2022
2. https://aws.amazon.com/what-is/restful-api/ accessed on 12/2/2022
3. https://restfulapi.net/rest-architectural-constraints/ accessed on 12/2/2022
This blog is an extension of chapter 6 of the apprenticeship patterns which talks about creating your own curriculum. The message is that t...