http, https,ajax,axios
http, https,ajax,axios
『九离~空白』
When you are strong enough, the whole world will be kind to you.Work hard to learn new techniques so that you can achieve your dreams and go further.
展开
-
Axios 简单总结
前言: 最近在项目中,使用 Axios 做前后端的请求交互,这里对它做一个简单总结。首先我们需要了解一下,前端开发演变: 静态网页阶段:这个阶段的网页没有数据交互,所有的前端数据都由后端生成、维护,前端只负责纯粹的展示功能。如果需要更新页面内容,必须重新加载整个网页。带来的问题是:当我们只希望更新页面中一小部分的内容时,会因为重载网页而对页面中的所有资源也重新加载一遍,不仅用户体验不友好,还增加了服务器的负担。 Ajax 阶段:为了解决上述问题,在 2004 年诞生了 Ajax 技术,让页面...原创 2020-11-11 18:21:09 · 199 阅读 · 0 评论 -
关于Ajax知识的总结三
Get 请求实例链接 GET 请求的数据传递: GET 请求一般用于信息获取,它没有请求主体,而是使用 URL 传递参数(即:传递数据给后台); GET 传递参数的方式,分两步: 对所需发送的数据(具有名称和值)执行普通的 URL 编码,即:由一对对 "名称=值" 组成(称为:名/值对),每一对之间用 "&"拼接,如 "name=value&name=value&...原创 2020-05-07 14:45:10 · 151 阅读 · 0 评论 -
关于Ajax的总结二
同源策略实例链接 什么是同源策略? 同源策略是一种安全协议,是客户端脚本(尤其是 JavaScript)中重要的安全度量标准,指一段脚本只能读取同一来源的窗口和文档的属性。划重点:何为同源?同源指的是 URL 地址中的 协议、域名、端口三者都相同。 URL 地址可以有以下几个组成部分? 一个 URL 地址可以有以下几个组成部分:scheme: //host:post/path?quer...原创 2020-05-07 14:13:31 · 157 阅读 · 0 评论 -
关于Ajax知识的总结一
Ajax基础:实例链接 前端开发的演变: 静态网页阶段: 这个阶段的网页没有数据交互,所有的前端数据都由后端生成、维护,前端只负责纯粹的展示功能。如果需要更新页面内容,必须重新加载整个网页。带来的问题是:当我们只希望更新页面中一小部分的内容时,会因为重载网页而对页面中的所有资源也重新加载一遍,不仅用户体验不友好,还增加了服务器的负担。 Ajax 阶段: 为了解决上述问题,在 2004 年诞...原创 2020-05-07 13:14:56 · 139 阅读 · 0 评论 -
DNS 和 CDN 相关 ?
什么是 DNS ? DNS:域名解析系统,把对应域名转换为 IP 地址,由名称解析器(resolver),域名空间(domain name space),名称服务器(name server)三部分组成。 域名组成:[ 主机名 ].[ 二级域名 ].[ 顶级域名 ]。 DNS 查询过程 ? 思考下,DNS 是怎么通过域名来查出 IP 的呢 ?(www.example.com为例) 检查浏览器缓存。 检查操作系统缓存,常见的如 hosts 文件。 检查路由器缓存。 如果前几步都没没找到...原创 2020-10-15 16:21:05 · 243 阅读 · 0 评论 -
HTTPS 加密 ?
前言 : 我们知道 HTTP 协议是明文传输,在早期只展示静态内容时没问题。随着互联网的快速发展,人们对于网络传输安全性的要求也越来越高,HTTPS 协议因此出现。 HTTPS 协议 ? HTTPS: 超文本传输安全协议,是以安全为目标的 HTTP 通道,可以理解为 HTTP 的安全版。 采用对称加密和非对称加密结合的方式来保护浏览器和服务器之间的通信安全。 对称加密算法加密数据+非对称加密算法交换密钥+数字证书验证身份 = 安全。 HTTPS 其实由两部分组成:HTTP + SSL...原创 2020-10-15 12:01:22 · 119 阅读 · 1 评论 -
浏览器同源策略,常见实现跨域方式 ?
什么是同源策略 ? 同源:协议,域名,端口号,三者相同。 同源策略:是浏览器本身的安全策略。浏览器不能执行其他网站的脚本,用于限制一个 origin 的文档或者它加载的脚本如何能与另一个源的资源进行交互,它能帮助阻隔恶意文件,减少可能被攻击的媒介。是一种约定,它是浏览器最核心,最基本的安全功能。 什么是跨域 ? 跨域:指的是非同源的资源之间尝试着进行交互通信,而由于受浏览器同源策略的限制,无法正常进行交互通信。 跨域出现的原因:浏览器同源策略限制,浏览器不能执行其他网站的脚本。它是由浏览..原创 2020-10-14 10:51:51 · 225 阅读 · 0 评论 -
HTTP2_特性,HTTP_相关
HTTP2_特性: 二进制传输 在之前的 http1.x 中,是通过文本传输的,http2中所有的传输数据都会被分割,并采用二进制编码。 多路复用 在 HTTP2 中有两个概念,流 (stream) 和 帧 (frame) 。帧是最小单位,每个帧都会有 Stream Identifier 来标记它属于哪个流。 在 http1.x 中,每个 HTTP 请求会建立一个 TCP 连接,也就意味着每个请求都要进行三次握手,这会造成时间和资源上的浪费,而且浏览器会限制同一域名下并发请求的个数,...原创 2020-10-13 15:11:50 · 320 阅读 · 0 评论 -
浏览器中,页面加载过程中做了哪些事情 ?
前言: 首先我们来思考下,当我们在浏览器搜索框中,输入一个 URL 网址,按下回车键后,会出现我们想要的页面信息。那么在这个过程中,都发生了哪些事情 ?一个页面是如何从有到无的 ?一个链接是怎么样读取到渲染的页面的 ?对于这些问题,做一个相关知识点的总结。 页面加载过程发生了什么 ? DNS 域名解析。 建立 TCP 连接(三次握手)。 发送 HTTP 请求。 服务器端处理请求。 返回响应结果。 关闭 TCP 连接(四次挥手)。 浏览器解析 HTML。 浏览器页面布局渲染。 DN原创 2020-10-13 12:01:00 · 706 阅读 · 0 评论 -
关于浏览器缓存策略 ?
前言: 先思考一个问题,我们知道,前端和后端通过 Ajax 发送请求来进行数据的交互。那么是不是每次通过请求 URL 获取资源都要发请求,在服务器端返回对应的新数据呢 ? 答案是不会,为了提高页面性能,浏览器提供了缓存策略。 什么是浏览器缓存 ? 浏览器每次发起请求时,先在本地缓存中查找结果已经缓存标识,根据缓存标识来判断是否使用本地缓存。如果缓存有效,则使用本地缓存,否则则向服务器发起请求并携带缓存标识。根据是否需向服务器发起 HTTP 请求,将缓存过程划分为两个部分:强制缓存和协商缓...原创 2020-10-12 16:39:50 · 194 阅读 · 0 评论 -
你能说出常见的 web 攻击方式吗 ?
前言 : 对于 web 开发者来说,熟悉常见的 web 攻击方式,和对应的解决方法,这是必须的。不仅仅要了解,还要在自己平时开发的时候考虑到可能产生的安全隐患,尽量在编写代码的时候就杜绝。做好网站初步的防护工作。下面就对平时开发中,需要考虑到的一些安全攻击方法做一个总结概括。 一,跨站脚本攻击 (XSS): 什么是 XSS? 跨站脚本攻击指的是恶意攻击者往 web 页面插入可执行网页脚本代码,当用户浏览该页面的时候,嵌入的恶意代码会被执行。从而达到盗取用户信息或其他侵犯用户安全隐私的目标。 ..原创 2020-07-13 22:02:43 · 211 阅读 · 0 评论 -
常见的 HTTP 状态码,你能说出多少 ?
HTTP 状态码 ? 分为 5 种类型 : 1** :信息,服务器收到请求,需要请求者继续执行操作。 2** :成功,操作被成功接收并处理。 3** :重定向,需要进一步的操作以完成请求。 4** :客户端错误,请求包含语法错误或无法完成请求。 5** :服务器错误,服务器在处理请求的过程中发生了错误。 常见之(1**) : 100: 客户端应当继续发送请求。 101: 服务器已经理解了客户端的请求,并将通过Upgrade 消息头通知客户端采用不同的协议来完成这个请求。。 10...原创 2020-06-29 22:09:55 · 249 阅读 · 0 评论 -
你能说出 Cookie,Session,Token,JWT 的区别吗 ?
这篇文章是对于 Cookie,Session,Token,JWT 区别的一个总结: 前置知识 : 什么是 认证 ,授权,凭证? 认证 : 验证当前用户身份。 互联网中的认证 :用户名密码登录;邮箱发送登录链接;手机号接收验证码等。 授权 :用户授权第三方应用访问该用户某些资源的权限。 实现授权的方式有 :cookie,session,token,OAuth。 凭证 :实现认证和授权的前提是需要一种媒介(证书)来标记访问者的身份。 一般网站中,当用户登录成功后,服务器会给该用户使用的浏...原创 2020-06-29 20:31:09 · 285 阅读 · 1 评论