-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0.4.code.txt
More file actions
31 lines (26 loc) · 1.07 KB
/
Copy path0.4.code.txt
File metadata and controls
31 lines (26 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
title Ex 0.4 - Adding note "old school"
user->browser: writes into text field "note"
user->browser: clicks on submit button
note over browser: browser collects form data
browser->server: HTTP POST https://studies.cs.helsinki.fi/exampleapp/new_note [note: <url-encoded-note>]
note over server:
server creates a new note object from the note property of the request body
and adds it to its data structure
end note
server-->browser: redirect to /exampleapp/notes
browser->server: HTTP GET https://studies.cs.helsinki.fi/exampleapp/notes
server-->browser: HTML-code
browser->server: HTTP GET https://studies.cs.helsinki.fi/exampleapp/main.css
server-->browser: main.css
browser->server: HTTP GET https://studies.cs.helsinki.fi/exampleapp/main.js
server-->browser: main.js
note over browser:
browser starts executing js-code
that requests JSON data from server
end note
browser->server: HTTP GET https://studies.cs.helsinki.fi/exampleapp/data.json
server-->browser: [{ content: "...", date: "..." }, ...]
note over browser:
browser executes the event handler
that renders notes to display
end note