This commit is contained in:
2024-12-07 21:07:38 +01:00
parent 2fded76a5c
commit a9676272f2
120 changed files with 15925 additions and 1 deletions

View File

@ -0,0 +1,90 @@
---
type: practical
---
The web $\neq$ The internet
![As portrayed in CN](Pasted%20image%2020241121115442.png)
As portrayed in CN
## URIs
A **URI (Uniform Resource Identifier)** identifies a resource, either by its name or location, and includes both URLs and URNs. A **URL (Uniform Resource Locator)** is a type of URI that specifies the exact location of a resource on the web, including its access method (e.g., HTTP, FTP).
Bad naming...
* URLs and URNs are **URI Schemes**
* URLs - `transport://user:password@host:port/path[?search][#fragmentid]`
* URNs - Is a logical address of a resource
## HTTP
- Port 80 usually
- TCP
### MIME
**MIME (Multipurpose Internet Mail Extensions)** is a standard that extends email and web protocols to support text in character sets other than ASCII, as well as attachments like images, audio, video, and other file types.
**HTTP does not have these built-in!**
- No state retained between request/response pairs
- Connections **can** persist
![Server_client](server_client.canvas)
| Term | Explanation |
| ------------- | ----------------------------------------------- |
| Origin Server | Server where resources reside |
| Proxy | Program that can act on behalf of origin server |
| Gateway | Intermediary for some other server |
| Tunnel | Relay between two connections (blindly) |
---
### Content negotiation
- Content can be available in multiple variants
- Representation is to be served based on the **content negotiation mechanism**
| Type of content negotiation | Description |
| --------------------------- | -------------------------------------------------------------------- |
| Server-driven | Client includes headers and server tries to find stuff based on them |
| Client-driven | Server responds with a list of available types and client picks |
---
### Messages & methods
Cool diagram expressing how protocols are being nested:
![](Pasted%20image%2020241121120647.png)
#### Request message (BNF)
```js
HTTP-message = request-line | status-line message-header* CRLF message-body? message-header = general-header | entity-header | request-header | response-header (general | entity | request | response)-header = field-name ":" field-content CRLF
```
#### **General Headers**
- `Cache-Control`: Caching directives.
- `Connection`: Manage persistent connections.
- `Transfer-Encoding`: Encoding (e.g., `chunked`, `gzip`).
- `Via`: Tracks intermediaries and routing.
#### **Entity Headers**
- `Content-Encoding`: Compression (e.g., `gzip`).
- `Content-MD5`: Body integrity check.
- `Expires`: Response expiry date.
- `Last-Modified`: Last entity update timestamp.
### Request methods
- GET, DELETE, POST, PUT, etc.
- They NEED to be used accordingly, although you are not forced to do it at all
- Idempotent[^1] requests are side-effects free
![](Pasted%20image%2020241121121317.png)
[^1]: Describing an action which, when performed multiple times, has no further effect on its subject after the first time it is performed.

View File

@ -0,0 +1,27 @@
---
type: practical
---
### World Wide Web
- Uniform Resource Locators (**URL**)
- Hyperlinks
- Internet
### Hypertext
- See [HTTP](https://en.wikipedia.org/wiki/HTTP)
### Brief history
- First web server 1990
- First browser 1990
- First NSCA Mosaic browser in 1993
- First company dedicated to browsers in 1994
- First WWW conference in 1994
- Netscape! in late 1994
- IE 1 1995
#### Browser wars
- First war
- Netscape v. Microsoft
- Second war
- Google v. everybody else
- Firefox was created by ex Netscape ppl

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -0,0 +1,51 @@
{
"nodes": [
{
"id": "817481f214fc30a4",
"type": "text",
"text": "Client :LiUser:",
"styleAttributes": {},
"x": -131,
"y": -272,
"width": 129,
"height": 60
},
{
"id": "28732c8def8fa454",
"type": "text",
"text": "Server :LiComputer:",
"styleAttributes": {
"textAlign": "center"
},
"x": 120,
"y": -272,
"width": 135,
"height": 60
}
],
"edges": [
{
"id": "011f5b95e0100cc5",
"styleAttributes": {
"pathfindingMethod": "square"
},
"fromNode": "817481f214fc30a4",
"fromSide": "top",
"toNode": "28732c8def8fa454",
"toSide": "top",
"label": "Request"
},
{
"id": "29184338e8002da5",
"styleAttributes": {
"pathfindingMethod": "square"
},
"fromNode": "28732c8def8fa454",
"fromSide": "bottom",
"toNode": "817481f214fc30a4",
"toSide": "bottom",
"label": "Response\n\n"
}
],
"metadata": {}
}