入门知识回顾小结

1.计算机是如何存储数据的

  • 计算机只能存0和1,那么他就可以存2进制的所有数字
    存0~9,把10进制转为2进制
    ASCII表存英文
    GBK(微软出国家标准扩展,GB2312中国出) 汉字库
    Unicode 包含所有字符
    utf-8 优化Unicode,节省空间
    墨菲定律:小概率必发生

2.命令行

image.png

3.HTTP请求与响应

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
GET /?w=1 HTTP/1.1
Host: baidu.com
Accept: text/html

响应

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 10000

<!DOCTYPE>
<html>......</html>

POST 请求

POST /login?w=1 HTTP/1.1
Host: baidu.com
Accept: application/ms-word
Content-Type: application/x-www-form-urlencoded
Content-Length: 10

username=fangfang&password=mima

响应

HTTP/1.1 403 Forbidden
Content-Type: application/md-word
Content-Length: 200

word格式

比喻版请求与响应

1
2
3
4
5
6
7
8
9
10
11
12
13
工资请求

GET 11月工资 工资协议/1.1
Host: 百度公司
Accept: 现金, 支付宝转账, 银行汇款

工资响应

工资协议/1.1 200 OK
类型: 现金
现金张数: 10

100

请求头和文件没有半毛钱关系
协议的字符集权重是大于内容的字符集权重 ,意思就是前端和后台同时定义charset,听后端的

4.CSS

herf和src分别在什么时候用
image.png