Docsity

Chapter_8_Web_Technologies_and_API_Integration, Lecture notes of Computer Fundamentals

Toggle sidebar
bg1
CH AP TE R 08 • A PP LIE D COM PUT IN G
Web Technologies & API Integration
Topic: Frontend Stack, RESTful Architecture, HTTP Methods & Stateless Auth
1. Core Client-Side Web Stack
Modern browser applications separate structure, visual presentation, and interactive behavior into three distinct layers:
HTML5: Defines semantic document structure ( <header> , <main> , <article> ) for accessibility and search
indexing.
CSS3: Controls layout grids, responsive breakpoints, typography, and color themes.
JavaScript: Manipulates the Document Object Model (DOM) and executes asynchronous network requests via fetch() .
2. RESTful API Principles & HTTP Methods
A REST API exposes server resources through clean URLs (such as /api/v1/orders/42 ) and exchanges lightweight
JSON payloads. Every request must be stateless , meaning it carries all context needed to process it.
HTTP Verb CRUD Action Idempotent? Typical Success Code
GET Read / retrieve resource Yes 200 OK
POST Create a new resource No 201 Created
PUT Replace an existing resource Yes 200 OK
DELETE Remove a resource Yes 204 No Content
3. HTTP Status Code Categories & Token Auth
2xx (Success): Request received, understood, and fulfilled cleanly.
4xx (Client Error): Invalid syntax ( 400 ), missing login ( 401 ), forbidden role ( 403 ), or missing route ( 404 ).
5xx (Server Error): Backend crash or upstream gateway timeout ( 500 , 503 ).
Stateless Authentication with JWT
After verifying credentials, an API issues a signed JSON Web Token (JWT). The client attaches Authorization:
Bearer <token> to future headers so the server can verify identity cryptographically without storing session memory.
•
•
•
•
•
•

Partial preview of the text

Download Chapter_8_Web_Technologies_and_API_Integration and more Lecture notes Computer Fundamentals in PDF only on Docsity!

CH AP T ER 08 • AP PLIED COMPUTING

Web Technologies & API Integration

Topic: Frontend Stack , RESTful Architecture, HTTP Methods & Stateless Auth

1. Core Client-Side Web Stack

Modern browser applications separate structure, visual presentation, and interactive behavior into three distinct layers:

HTML5: Defines semantic document structure ( , , ) for accessibility and search indexing. CSS3: Controls layout grids, responsive breakpoints, typography, and color themes. JavaScript: Manipulates the Document Object Model (DOM) and executes asynchronous network requests via fetch().

2. RESTful API Principles & HTTP Methods

A REST API exposes server resources through clean URLs (such as /api/v1/orders/42 ) and exchanges lightweight JSON payloads. Every request must be stateless , meaning it carries all context needed to process it.

HTTP Verb CRUD Action Idempotent? Typical Success Code GET Read / retrieve resource Yes 200 OK POST Create a new resource No 201 Created PUT Replace an existing resource^ Yes^ 200 OK DELETE Remove a resource Yes 204 No Content

3. HTTP Status Code Categories & Token Auth

2xx (Success): Request received, understood, and fulfilled cleanly. 4xx (Client Error): Invalid syntax ( 400 ), missing login ( 401 ), forbidden role ( 403 ), or missing route ( 404 ). 5xx (Server Error): Backend crash or upstream gateway timeout ( 500 , 503 ).

Stateless Authentication with JWT After verifying credentials, an API issues a signed JSON Web Token (JWT). The client attaches Authorization: Bearer to future headers so the server can verify identity cryptographically without storing session memory.