remove internet slides and images
@ -1,171 +0,0 @@
|
|||||||
# Introduction to the Internet
|
|
||||||
|
|
||||||
# What is the Internet?
|
|
||||||
|
|
||||||
* Web != the Internet
|
|
||||||
* Internet: connected networks that use the TCP/IP protocol
|
|
||||||
* made out of billions of computers, cables and antennae directing data to the right direction.
|
|
||||||
* Web (www): URL-based information system.
|
|
||||||
* a big part of the Internet but it consists of other kinds of traffic, too:
|
|
||||||
* Email
|
|
||||||
* VoIP (Skype/Teamspeak)
|
|
||||||
* File transfers between computers
|
|
||||||
* Remote connections to other computers
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# HTTP
|
|
||||||
|
|
||||||
* __HTTP __ (Hypertext Transfer Protocol) is a TCP/IP based communication protocol, which provides a standardized way for computers to communicate with each other
|
|
||||||
* The communication happens between a client (browser, application…) and a server
|
|
||||||
* The client sends a __request__ , and the server returns a __response__
|
|
||||||
* HTTP is __connectionless__ :
|
|
||||||
* The client and server are only aware of each other during the request-response phase
|
|
||||||
* After that, each new request is sent through a new connection
|
|
||||||
---
|
|
||||||
|
|
||||||
TCP = Transmission Control Protocol; Controlled stream of bytes between applications communicating via an IP network
|
|
||||||
IP = Internet Protocol; Delivering packets from host to destination with IP addresses
|
|
||||||
|
|
||||||
# HTTP (continued)
|
|
||||||
|
|
||||||
Server Side Script
|
|
||||||
|
|
||||||
_HTTP protocol acts as a communication bus between the web client (e.g. web browser) and the web server. There can be multiple clients connected to the server simultaneously. The clients are not connected to each other but only to the server._
|
|
||||||
|
|
||||||
# HTTP Requests
|
|
||||||
|
|
||||||
* HTTP requests have the following format:
|
|
||||||
* Request line: request method, request URI
|
|
||||||
* Example: GET [https://example.com/products](https://example.com/products)
|
|
||||||
* Headers (optional)
|
|
||||||
* Example: Date: Mon, 07 Sep 2020 08:39:33 GMT
|
|
||||||
* Example: Content-Type: application/json
|
|
||||||
* Body (optional)
|
|
||||||
* Example:
|
|
||||||
* {
|
|
||||||
* "date": "2020-09-08T11:39:34.2837813+03:00",
|
|
||||||
* "temperatureC": 11,
|
|
||||||
* "temperatureF": 51,
|
|
||||||
* "summary": "Cool"
|
|
||||||
* }
|
|
||||||
|
|
||||||
# HTTP Requests (continued)
|
|
||||||
|
|
||||||
Some example HTTP request messages:
|
|
||||||
|
|
||||||
| __Method__ | __URI__ | __Headers__ | __Body__ |
|
|
||||||
| :-: | :-: | :-: | :-: |
|
|
||||||
| __GET__ | __http://someserver.com/__ | | |
|
|
||||||
| __GET__ | __http://someserver.com/10__ | | |
|
|
||||||
| __POST__ | __http://someserver.com/users__ | __Content-Type: application/json__ | __{"name": "Dan"}__ |
|
|
||||||
| __DELETE__ | __http://someserver.com/users/2__ | | |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Also request header fields
|
|
||||||
|
|
||||||
# PORT numbers
|
|
||||||
|
|
||||||
__The port number (16 bit unsigned integer) defines a port through which the communication to your application happens. Ports allow multiple applications to be located on the same host (IP).__
|
|
||||||
|
|
||||||
__The client connects to this port in some server (defined by an IP address), so the client and the server are able to communicate.__
|
|
||||||
|
|
||||||
__Computers have several different ports at their disposal __ _but_ __ some of them are being used and your application might not be able to assign those ports to itself.__
|
|
||||||
|
|
||||||
__Ports from 0 to 1023 are the system ports. There are restrictions in manually assigning applications to use them.__
|
|
||||||
|
|
||||||
__Generally speaking, ports from 1024 to 65535 are available for user to assign applications to use them.__
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# Back-end vs Front-end
|
|
||||||
|
|
||||||
* Web development is split into _Back-end_ and _Front-end_
|
|
||||||
* Front-end is the website users can actually see
|
|
||||||
* Visual elements of a website or app the user can interact with
|
|
||||||
* Back-end is the invisible part
|
|
||||||
* "Server side" where user's data is stored
|
|
||||||
* Back-end is not interacted with directly, but gives and modifies its stored data based on user requests
|
|
||||||
* _Full stack development_ refers to working on both back-end and front-end!
|
|
||||||
|
|
||||||
# Front-end anatomy of a website
|
|
||||||
|
|
||||||
* Historically, websites looked something like this
|
|
||||||
* [https://web.archive.org/web/19970129232848/http://www.iltalehti.fi/](https://web.archive.org/web/19970129232848/http://www.iltalehti.fi/)
|
|
||||||
* Nowadays, a website can even be a full-blown application!
|
|
||||||
* [https://open.spotify.com/](https://open.spotify.com/)
|
|
||||||
* old and new sites alike are written in _HTML_ __, __ which describes the _structure _ of the site
|
|
||||||
* In mid-90s, plain HTML was extended with _CSS_ _ _ to implement _styling_
|
|
||||||
* The third building block of a website is JavaScript, or _JS,_ which is used to add _interactivity_
|
|
||||||
|
|
||||||
# Backend
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
* Backend handles e.g.,
|
|
||||||
* saving and fetching user data from a _database_
|
|
||||||
* user authentication and connecting multiple users together (chat apps!)
|
|
||||||
* Databases are used with _query languages_ like _SQL_
|
|
||||||
* Back-end software can be written with various different programming languages
|
|
||||||
* even with JavaScript! See: [Express](https://expressjs.com/)
|
|
||||||
* Simple websites don't require a dedicated back-end
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
© Buutti Oy, All Rights Reserved
|
|
||||||
|
|
||||||
# What is a server or "the Cloud"
|
|
||||||
|
|
||||||
* A Server or "the cloud" is just another computer
|
|
||||||
* Server software is constantly running
|
|
||||||
* Usually in data centers
|
|
||||||
* Your own computer could be a server!
|
|
||||||
* When you access a website your computer calls another computer that sends you the website
|
|
||||||
* If you need to save an image, post a comment on a news website, or just load a website, you send a _request _ to a server
|
|
||||||
* Server then gives an appropriate _response_ based on the request
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# APIs
|
|
||||||
|
|
||||||
__APIs __ (Application Programming Interface) define a way of communicating between applications
|
|
||||||
|
|
||||||
With the help of APIs, you don't need everything to run in one place or even create all functionality yourself!
|
|
||||||
|
|
||||||
Each program defines their own interface (if they have one), and for other programs to consume it, they have to implement it specifically
|
|
||||||
|
|
||||||
There are some architectural models like __REST__ , which exist to help make APIs more general
|
|
||||||
|
|
||||||
__API in simple terms__
|
|
||||||
|
|
||||||
Most of the work is handled by the API and not the user.
|
|
||||||
|
|
||||||
Application 1(user)
|
|
||||||
|
|
||||||
Application 2(user)
|
|
||||||
|
|
||||||
Application 3(user)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
E.g. filtering method; should you have that in the client code or the server?
|
|
||||||
|
|
||||||
__APIs are everywhere__
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Application 1(user)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
Before Width: | Height: | Size: 328 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 306 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 3.7 MiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |