请求方法
- get:被用来检索数据,retreive data from a server at the specified resource.
get请求仅仅用来请求数据,并不是修改任何resources。是一种安全有效的方式。 - post:be used to send data to the API server to create or update a resource。被用来发送数据给服务端来修改或者创建数据。数据被用来存储在http请求的request body里。
- put:simlar to post.
- patch:
- delete:
Request
- Javax.servlet.http.HttpServletRequest
GetHeader()
Return String 对request header 的详细说明,specified
If 请求中不包含 not include a header of specified name ,return null
If 对于 same name ,there are multiple headers,这个方法return the first head in the request,返回请求中的第一个head,the header name is case insensitive头名是不区分大小写的,你可以使用this method whis any request header
Public java.lang.String getheader(java.lang.String name)
Response
JSON
- 模拟数据格式:单条数据
{"a":"2.12","b":"2.12"}
- 数组格式:
{"a":"",
[
{"b":"b1","c":"2.12"},
{"b":"b1","c":"2.12"}
]
}
- 字符串格式:
{
"engineeringId":"01",
"versionId":"01",
"documentId":"01",
"calculationFloor":"1楼",
"elevationList":["a","b"]
}
-
String[] ids和List ids在Get请求和Post请求的不同处
在postman中的post请求方式同下:
[“1”,“2”,“3”]
get请求:param:ids 1,3 ————>最后路径中/api/delete/ids=1,3
get请求下:String[] 到controller层会转化为{“1”,“3”}
List<> 下就是size =2 的形式 -
List 转JSONArray 再转String
JSONArray.parseArray(JSON.toJSONString(ids)).toString
和JSON.toJSONString(ids)是等价的
协议
SSH协议:Sexure Shell
三部分组成:传输层协议,用户认证协议,连接协议
连接协议运行在最上面。提供交互式登录话路,,远程命令执行,转发tcp/ip连接和转发x11连接。
传输协议在最底层
HTTP/2
HTTP/2的新特性:https://www.ibm.com/developerworks/cn/web/wa-http2-under-the-hood/index.html
(1)新升级路径
(2)二进制协议,二进制分帧层
单个TCP连接上,在客户端和服务端,通过逻辑流进行传递
TLS(Transport Layer Security):安全传输协议 两个通信应用程序之间提供保密性和数据完整性。
该协议由两层组成: TLS 记录协议(TLS Record)和 TLS 握手协议(TLS Handshake)。
前身是SSL 安全套接层,Secure Sockets Layer