java post 提交数据_javaweb post方式提交数据

POST /webday01/j1.jsp HTTP/1.1 -- 请求首行

Connection: keep-alive -- 请求头

Content-Length: 14 -- 发送的请求体的长度,字节

Cache-Control: max-age=0

Origin: http://localhost:8080

Upgrade-Insecure-Requests: 1

Content-Type: application/x-www-form-urlencoded

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8

DNT: 1

Referer: http://localhost:8080/webday01/

Accept-Encoding: gzip, deflate, br

Accept-Language: zh-CN,zh;q=0.8

Cookie: JSESSIONID=3B4239FFB568DBE85D0B07CFD62BC051

空行

请求体

username=小可爱

post方式:

form表单自动将 input 标签 中的 name 和value ,构成键值对,键值对中间加“=” 作为请求体的内容

优点:安全。传递数据大小没有限制。

get方式:

formt表单提交,自动将input标签中的name和value,构造键值对,键值对中间加“=” ,并且附加到url中,进行传递。

缺点:不安全。传递的数据有大小限制 默认:1024个字节

HTTP/1.1 200 OK -- 响应首行

Server: Apache-Coyote/1.1 -- 响应头

Content-Type: text/html;charset=UTF-8

Content-Length: 115

Date: Tue, 10 Oct 2017 09:14:53 GMT

空行

-- 响应体

Title

this is j1.jsp 页面

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值