Some concepts you need to know to learn the web

Author: San Nian


1. web: network

网络:由计算机和路由器组合而成的。

多台计算机同时通信。路由器
多台计算机之间彼此之间可以进行通信
功能比较强大的计算机就是服务器。

2. web application

在网络上运行的程序。(QQ,lol,dota,sina,百度)

3. Web applications are divided into 2 categories

C/S 结构:client /Server 客户端和服务器(QQ,LOL,DOTA)
B/S 结构:Browser/Server 浏览器和服务器(SINA,百度)

Advantages:
C/S: Relatively safe, less pressure on the server, more personalized, and more powerful (you know your own protocol)
B/S: Convenient, fast update, no need to install the client, so save space. (Http protocol is not so secure, all follow the language)

4. How the B/S structure communicates

浏览器和服务器之间的通信是通过HTTP协议来实现。

5. HTTP (hyper text transport protocol) protocol

无状态:HTTP协议是无状态协议。无状态是指协议对于事务处理没有记忆能力。缺少状态意味着如果后续处理需要前面的信息,则它必须重传,这样可能导致每次连接传送的数据量增大。另一方面,在服务器不需要先前信息时它的应答就较快。

6.TCP/IP

在请求一次以后,会建立一个通讯栈道,无需再请求,需要手动关闭
占用资源多,对服务器资源使用率高

7.Session,Cookie

由于http是无状态的,但是呢,应用程序操作是有状态的(购物车)。所以出现了处理有状态的技术:session,cookie.(sesssion,cookie中的数据可以在多次请求中访问到。)

8. http response status code

200 OK      //客户端请求成功
400 Bad Request  //客户端请求有语法错误,不能被服务器所理解
401 Unauthorized //请求未经授权,这个状态代码必须和WWW-Authenticate报头域一起使用 
403 Forbidden  //服务器收到请求,但是拒绝提供服务
404 Not Found  //请求资源不存在,eg:输入了错误的URL
500 Internal Server Error //服务器发生不可预期的错误
503 Server Unavailable  //服务器当前不能处理客户端的请求,一段时间后可能恢复正常

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326705030&siteId=291194637