Http请求与响应 contentType

Http请求
1、方法-URI-协议/版本;
2、请求头信息;
3、请求正文;

Http响应
1、协议-状态码-描述;
2、响应头信息;
3、响应正文;

HttpServletResponse
--回的ContentType类型
[url]http://ewf-momo.iteye.com/blog/1902634[/url]
google pb: Content-Type=application/x-protobuf
--Java中都通用文件下载(ContentType、文件头、response、out四步骤)
[url]https://www.cnblogs.com/leihenqianshang/articles/3937579.html[/url]

Web服务器
--http 百度百科
[url]https://baike.baidu.com/item/http/243074?fr=aladdin[/url]
--http协议学习系列
[url]http://www.blogjava.net/zjusuyong/articles/304788.html[/url]

Http响应状态码;
[url]https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html[/url]

MIME type文件类型:
[url]http://www.w3school.com.cn/media/media_mimeref.asp[/url]

Timeout:
---- HTTP请求时候总是设置的两个参数ConnectionTimeOut和SocketTimeOut
[url]http://www.cnblogs.com/hym-pcitc/p/5681192.html[/url]

---- HTTP请求时connectionRequestTimeout 、connectionTimeout、socketTimeout三个超时时间的含义
[url]http://blog.csdn.net/wangjin890620/article/details/54630219[/url]

--post和get请求的Headers和Response示例

================================
1、POST请求
================================
【General】
Request URL: https://stu.demo.com/stu-gateway-demo/stu-base/plan/pagePlanList
Request Method: POST
Status Code: 200 OK
Remote Address: 192.168.1.199:443
Referrer Policy: no-referrer-when-downgrade

【Response Headers】
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://10.157.100.100:3000
Connection: keep-alive
Content-Type: application/json;charset=UTF-8
Date: Wed, 29 Aug 2018 07:20:46 GMT
Keep-Alive: timeout=10
Server: nginx
Transfer-Encoding: chunked

【Request Headers】
Accept: application/json, text/plain, */*
authorization: {"uname":"ming.wang","sId":"87b24be534eb418047fd5b08c076f40e039147fa","decrypt":"b10268dd"}
Content-Type: application/json;charset=UTF-8
Origin: http://10.157.100.100:3000
Referer: http://10.157.100.100:3000/index.html?username=jie.sun&msg=b10268dd&devid=87b24be534eb418047fd5b08c076f40e039147fa
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

【Request Payload】
{
"curPage":1,
"pageSize":10,
"params":{"memoType":"1","qryRange":"1","visitBeginTime":"2018-08-29","visitEndTime":"2018-08-29","usercode":""},
"sortedMap":{"visitBeginTime":true}
}
================================
2、GET请求
================================
【General】
Request URL: https://stu.demo.com/stu-gateway-demo/stu-base/plan/statistics?qryRange=1
Request Method: GET
Status Code: 200 OK
Remote Address: 192.168.1.199:443
Referrer Policy: no-referrer-when-downgrade

【Response Headers】
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://10.157.100.100:3000
Connection: keep-alive
Content-Type: application/json;charset=UTF-8
Date: Wed, 29 Aug 2018 09:15:24 GMT
Keep-Alive: timeout=10
Server: nginx
Transfer-Encoding: chunked

【Request Headers】
Accept: application/json, text/plain, */*
authorization: {"uname":"ming.wang","sId":"87b24be534eb418047fd5b08c076f40e039147fa","decrypt":"b10268dd"}
Content-Type: application/json;charset=UTF-8
Origin: http://10.157.100.100:3000
Referer: http://10.157.100.100:3000/index.html?username=jie.sun&msg=b10268dd&devid=87b24be534eb418047fd5b08c076f40e039147fa
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

【Query String Parameters】
qryRange=1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值