之前整理过一篇 Spring MVC 中的传值方式。《Spring MVC 传值方式总结》
上传文件只允许上传doc、docx、jpg、png、gif和pdf格式的文件,需要在前后端进行双重限制
由于web应用大多数都在浏览器中进行操作,所以我们有必要先了解一下浏览器里面到底发生了什么。简而言之,当你在浏览器的地址栏中输入网址并按下回车,或者点击了网页上的某个链接时,浏览器就会按照网址给目标服务器发送请求。浏览器和服务器之间的请求遵循http协议,协议规定了所使用的格式,只有按照这种格式组织的数据才能相互识别。
HTTP和HTTPS HTTP(HyperText Transfer Protocol,超文本传输协议):是一种发布和接收HTML页面的方法 HTTPS(HyperText Transfer Protocol over Secure Socket Layer)简单讲是HTTP的安全版,在HTTP下加入SSL层。 SSL(Secure Socket Layer安全套接层)主要用于web的安全传输协议,在传输层对网络连接进行加密,保障在Internet上数据传输的安全。 HTTP的端口号为80 HTTPS
HTTP和HTTPS Cookie、Session HTTP请求方法(Get/Post) 一次HTTP请求的过程 一次请求(Request)和回复(Reply)的数据包 Request请求包 Reply回复包 HTTP Basic基本认证
年 , 只能进行 GET 请求 , 不能传输数据包 , 规定客户端服务器通信格式 ; ( 不是正式标准 )
HMR 全称 Hot Module Replacement,中文语境通常翻译为模块热更新,它能够在保持页面状态的情况下动态替换资源模块,提供丝滑顺畅的 Web 页面开发体验。
一、导入js库 <script src="../js/jquery.js" type="text/javascript"></script> <script src="../js/jquery.validate.js" type="text/javascript"></script> 二、默认校验规则 (1)required:true 必输字段 (2)remote:"check.php" 使用ajax方法调用check.php验证输入值 (3)email:
此前的文章中通过 log4j2 AsyncAppender 的源码介绍了异步日志的用法:
本文总结了 RESTful API 设计相关的一些原则,只覆盖了常见的场景。有些规则只是针对自己项目而言,并非其他做法都是错误的。 1. URI URI 表示资源,资源一般对应服务器端领域模型中的实体类。 URI规范 不用大写; 用中杠-而不用下杠_; 参数列表要encode; URI中的名词表示资源集合,使用复数形式; 资源集合与单个资源 资源集合: /zoos //所有动物园 /zoos/1/animals //id为1的动物园内的所有动物 单个资源: /zoos/1 //id为
HTTP 协议一共有四个阶段比较重要的阶段,分别是 0.9/1/2/3,其中1又分为1.0和1.1。
HTTP Header非常之多,很少有人能完全分清这些Header到底是干什么的。鉴于RFC文件规范艰深晦涩难懂,本文对协议规范中列出的HTTP Header进行了梳理,用通俗的语言进行表达,便于读者吃透HTTP协议。
跨域有多种方式,现在的情况看来还是CORS更适合一些,有很多优点,比如浏览器正式支持、支持post、可以控制跨域访问的网站等。
URL只是标识资源的位置,而HTTP是用来提交和获取资源。客户端发送一个HTTP请求到服务器的请求消息,包括以下格式:
在正则中也有特殊含义,匹配的是数字到非数字的边界("123!"匹配的是3和!之间),不是数据
Mod_deflate是一个Apache模块,它允许在发送到客户端之前压缩Web服务器的输出。一旦您的网站内容的大小被压缩,其大小就会变小,客户端可以更快地下载它。这不仅对于带宽较低的客户有价值,而且在评估您的网站性能和网页排名时也会被搜索引擎考虑在内。
从http四个字母来讲,它是Hypter transfer protocol超文本传输协议。
全国快递物流查询 API 是一种提供实时、准确、可靠的快递物流信息查询服务的接口。它基于现有的物流信息系统,通过API接口的方式,向用户提供快递物流信息的查询、跟踪、统计等功能。使用全国快递物流查询 API,用户可以在自己的应用程序或网站上,快速、方便地查询快递物流信息。
爬虫定义、分类和流程 爬虫定义 网络爬虫(又被称为网页蜘蛛,网络机器人)就是模拟浏览器发送网络请求,接收请求响应,一种按照一定的规则,自动地抓取互联网信息的程序。 爬虫就是模拟浏览器的行为,越像越好,
英文 | https://javascript.plainenglish.io/24-lesser-known-html-attributes-you-may-want-to-use-326dca041fdb
现在,当谈论起 RESTful Web API 的时候,人们总会想到 JSON。但是实际上,JSON 和 RESTful API 没有半毛钱关系,只不过 JSON 恰好是RESTful API 结果的表述格式。也就是说 RESTful API 还可以使用其它的表述格式,例如 xml 或私有的格式。这也就意味着,我们需要让 RESTful API 知道我们想要返回的格式。而这就是HTTP请求和响应的核心内容之一:
本文主要介绍如何使用原生js,通过面向对象的方式实现一个文件上传预览的组件,该组件利用FileReader来实现文件在前端的解析,预览,读取进度等功能,并对外暴露相应api来实现用户自定义的需求,比如文件上传,进度监听,自定义样式,读取成功回调等。
ES5 中只存在两种作用域:全局作用域和函数作用域。在 JavaScript 中,我们将作用域定义为一套规则,这套规则用来管理引擎如何在当前作用域以及嵌套子作用域中根据标识符名称进行变量(变量名或者函数名)查找
我们给某人发送邮件时,我们在传输之前把自己的文件压缩一下,接收方收到文件后再去解压获取文件。这中操作对于我们来说都已经司空见惯。我们压缩文件的目的就是为了把传输文件的体积减小,加快传输速度。我们在 http 传输中开启 gZip的目的也是如此,但是一般文章介绍 gZip 时候总是结合一些服务端配置(nginx)或者构建工具插件(webpack)来说,列出一大堆配置让人看的云里雾里,以至于到最后还没搞懂 为什么用,怎么用 这些问题。
什么是Dalvik: Dalvik是Google公司自己设计用于Android平台的Java虚拟机。 它可以支持已转换为.dex(即Dalvik Executable)格式的Java应用程序的运行。 .dex格式是专为Dalvik应用设计的一种压缩格式,适合内存和处理器速度有限的系统。 Dalvik经过优化,允许在有限的内存中同时运行多个虚拟机的实例,并且每一个Dalvik应用作为独立的Linux进程执行。 独立的进程可以防止在虚拟机崩溃的时候所有程序都被关闭。
一个 Vue 项目,使用的 AntDesign for Vue 的前端框架。图片上传使用的 Upload 组件,在微信访问 H5 页面,点击图片上传时提示“没有应用可执行此操作”。如下图所示:
当开发REST API时,从一开始就必须注意安全方面。 REST是通过URL路径元素表达系统中特定实体的手段。REST不是一个架构,而是一种在Web上构建服务的架构风格。 REST允许通过简单的URL(而不是复杂的请求主体或POST参数)与基于web的系统交互。 1 - 授权 (1)保护HTTP方法 RESTful API通常使用GET(读),POST(创建),PUT(替换/更新)和DELETE(删除记录)。 对于每个资源并非都要提供所有这些操作。 必须确保传入的HTTP方法对于会话令牌/API密
-多年互联网运维工作经验,曾负责过大规模集群架构自动化运维管理工作。 -擅长Web集群架构与自动化运维,曾负责国内某大型金融公司运维工作。 -devops项目经理兼DBA。 -开发过一套自动化运维平台(功能如下): 1)整合了各个公有云API,自主创建云主机。 2)ELK自动化收集日志功能。 3)Saltstack自动化运维统一配置管理工具。 4)Git、Jenkins自动化代码上线及自动化测试平台。 5)堡垒机,连接Linux、Windows平台及日志审计。 6)SQL执行及审批流程。 7)慢查询日志分析web界面。
网络(Network)面板记录页面上每个网络操作的相关信息,包括详细的耗时数据、HTTP请求与响应标头和Cookie,等等。这就是我们通常说的抓包。
近期安全测试时发现一个系统前台使用了SSO,但是在比较隐蔽API中发现了后台的登录接口,该接口未使用SSO,同时没有图形验证码等校验,通过分析最终爆破进入后台。
input的file类型在浏览器中会渲染为一个按钮和一段文字。当你点击按钮时会打开文件选择窗口,文字表示对文件的描述;如图:
在之前的ARP欺骗与中间人攻击讲到了MITM攻击的基础和原理,并且在实验中成功对网关和目标主机进行了ARP毒化,从而使得无论目标的外出数据或流入数据都会经过本机这个“中间人”。在后记里也略为提及到,中间人可以做的事情有很多,但是没有详细介绍。本文主要介绍了在ARP毒化和简单的DNS劫持情况下如何截获目标的会话和COOKIE等验证信息,以及如何对截获的会话进行简单修改。
通用网络爬虫 是 捜索引擎抓取系统(Baidu、Google、Yahoo等)的重要组成部分。主要目的是将互联网上的网页下载到本地,形成一个互联网内容的镜像备份。
WebUploader是由Baidu WebFE(FEX)团队开发的一个简单的以HTML5为主,FLASH为辅的现代文件上传组件。在现代的浏览器里面能充分发挥HTML5的优势,同时又不摒弃主流IE浏览器,沿用原来的FLASH运行时,兼容IE6+,iOS 6+, android 4+。两套运行时,同样的调用方式,可供用户任意选用。
1.accept=”application/msexcel” 2.accept=”application/msword” 3.accept=”application/pdf” 4.accept=”application/poscript” 5.accept=”application/rtf” 6.accept=”application/x-zip-compressed” 7.accept=”audio/basic” 8.accept=”audio/x-aiff” 9.accept=”audio/x-mpeg” 10.accept=”audio/x-pn/realaudio” 11.accept=”audio/x-waw” 12.accept=”image/gif” 13.accept=”image/jpeg” 14.accept=”image/tiff” 15.accept=”image/x-ms-bmp” 16.accept=”image/x-photo-cd” 17.accept=”image/x-png” 18.accept=”image/x-portablebitmap” 19.accept=”image/x-portable-greymap” 20.accept=”image/x-portable-pixmap” 21.accept=”image/x-rgb” 22.accept=”text/html” 23.accept=”text/plain” 24.accept=”video/quicktime” 25.accept=”video/x-mpeg2″ 26.accept=”video/x-msvideo”
问题:在浏览器中输入URL到整个页面显示在用户面前时这个过程中到底发生了什么。仔细思考这个问题,发现确实很深,这个过程涉及到的东西很多。
什么是毒汤日历 毒汤日历是一本有毒的日历,每天用毒鸡汤来唤醒你。 你甚至不用打开日历,打开 App 的推送,每天会定时送上一杯毒鸡汤。 自己也能制作毒鸡汤?那太好了,毒性够强,如果让别人扎到心你就厉害
什么是毒汤日历 毒汤日历是一本有毒的日历,每天用毒鸡汤来唤醒你。 你甚至不用翻开日历,翻开 App 的推送,每天会守时送上一杯毒鸡汤。 自己也能制作毒鸡汤?那太好了,毒性够强,如果让他人扎到心你就厉害了。 每条毒汤能够点扎心、发毒评,或许转发给他人,让他人也扎扎心。
网络应用程序,分为前端和后端两个部分。当前的发展趋势,就是前端设备层出不穷(手机、平板、桌面电脑、其他专用设备…)。因此,必须有一种统一的机制,方便不同的前端设备与后端进行通信。这导致API构架的流行,甚至出现”APIFirst”的设计思想。RESTful API是目前比较成熟的一套互联网应用程序的API设计理论。
本来啊,本来,本来我在准备完善这个鸽了四年的系列的时候,是打算按照时间的顺序来完成的,好吧。我承认那个时候考虑的稍稍稍稍稍微有些不足,就是我忽略了HTTP协议的“模块性“。因为虽然按照时间顺序写写流水账好像是个不错的选择,但是写着写着发现,其实HTTP的头字段,往往是一块一块的,这一块的部分包含了某一系列的字段作为请求和应答的协商方式。
什么是毒汤日历?毒汤日历是一本有毒的日历,每天用毒鸡汤来唤醒你。 你甚至不用打开日历,打开 App 的推送,每天会定时送上一杯毒鸡汤。 自己也能制作毒鸡汤?那太好了,毒性够强,如果让别人扎到心你就厉害了。 每条毒汤可以点扎心、发毒评,或者转发给别人,让别人也扎扎心。
---- I/O处理 关于 I/O ,有一个很经典的响水壶解释。 隔壁王大爷有个水壶,王大爷经常用它来烧开水。 同步阻塞:王大爷把水壶放到火上烧,然后啥也不干在那等,直到水开了王大爷再去搞别的事情。 同步非阻塞:王大爷觉得自己有点憨,不打算等了。把水壶放上去之后大爷就是去看电视,时不时来瞅一眼有没有开。 异步阻塞:王大爷去买了个响水壶,他把响水壶放在火上,然后也是等着水开,水开的时候水壶会发出声响。 异步非阻塞:王大爷又觉得自己有点憨,他把响水壶放在火上然后去看电视,这时他不用是不是来瞅一眼,因为水开 的
最近抽空参加了几场大厂的面试,突然发现一个现象,就是不论面试偏服务端的职位还是偏客户端的职位,不论面试的 5 年以上的高级职位,还是 3 年左右的中级职位,面试官开头所问问题必然是关于 HTTP 的。
Validate是用于B/S结构客户端验证用的JQuery扩展插件,使用时需要引用两个js文件,分别是: <script src="../Contents/JS/jquery-1.5.js" type="text/javascript"></script> <script src="../Contents/JS/jquery.validate.min.js" type="text/javascript"></script>
arr就是我们要的结果,是一个数组。每一个值是个对象,包含了code type两个属性。
案例地址:https://www.amec-inc.com 案例内容:某站点宝塔人机识别的cookie分析。(案例很简单,清空cookie后刷新页面可触发人机识别)
领取专属 10元无门槛券
手把手带您无忧上云