请求,响应

请求方法

  1. get:被用来检索数据,retreive data from a server at the specified resource.
    get请求仅仅用来请求数据,并不是修改任何resources。是一种安全有效的方式。
  2. post:be used to send data to the API server to create or update a resource。被用来发送数据给服务端来修改或者创建数据。数据被用来存储在http请求的request body里。
  3. put:simlar to post.
  4. patch:
  5. delete:

Request

  1. 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

  1. 模拟数据格式:单条数据
{"a":"2.12","b":"2.12"}
  1. 数组格式:
{"a":"",
[
{"b":"b1","c":"2.12"},
{"b":"b1","c":"2.12"}
]
}
  1. 字符串格式:
{
"engineeringId":"01",
"versionId":"01",
"documentId":"01",
"calculationFloor":"1楼",
"elevationList":["a","b"]
}
  1. 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 的形式

  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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值