Course Weighting
- Assignment 1 (25%)
- Mid-semester test (20%)
- Wed 24 March, 7pm, E8
- Assignment 2 (25%)
- Compulsory lab in final week
- Final Exam (30%)
The Basics
Modern web applications should:
- Consume services from another system
- Provide services to another system
- Be modular
- Be able to respond to multiple asynchronous request
- Make changes persistent
- Allow/restrict user access
- Synchronize information across views
- Be responsive (both speed and design)
Reference Model
HTTP/REST
SQL Queries <------>
DB <------> HTTP Server . API API . Browser
(Node.JS/Express) . .
------->
Static Resources
URIs and URLs
URI: Uniform Resource Identifier. String which identifies a resource.
URL: Uniform Resource Locator: URI with an access mechanism specified.
scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]
APIs
API can accept parameter information via multiple methods:
- URL query parameters
- URL path
- HTTP headers
- Request contents
APIs will usually use all three.
REST: Representational State Transfer
A way for developers to use HTTP methods explicitly and consistently in accordance with HTTP protocol definitions (counter-example: GET /path/user?id=1&action=delete; GET requests should never modify data)
CRUD
- Create:
POST - Retrieve:
GET - Update:
PUT - Delete:
DELETE