当前位置:网站首页>@RequestBody使用
@RequestBody使用
2022-08-02 07:29:00 【sebeefe】
使用场景
@RequestBody主要用来接收前端传递给后端的json字符串中的数据的(即请求体中的数据的);
使用与否
(1)使用@RequestBody的情况:
- 参数是放在请求体中
- 当请求content_type为:application/json类型的请求,数据类型为json时, json格式如下:
{“aaa”:“111”,“bbb”:“222”}
(2)不使用@RequestBody的情况:
- 接收URL中的数据并组装为对象
- 当请求content_type为:application/x-www-form-urlencoded类型的或multipart/form-data时,数据格式为
aaa=111&bbb=222
注意:
1、一个请求最多只能有一个@RequestBody注解
2、Content-type:
(1)application/x-www-form-urlencoded:@RequestBody不是必须加的
(2)mutipart/form-data:@RequestBody不能处理这种格式
(3)其他格式,比如application/json,application/xml等,必须使用@RequestBody来处理
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- WebForm DropDownList分别绑定年月
- Conditional constructor ~wapper
- MySQL-Execution Process + Cache + Storage Engine
- MySQL-慢查询日志
- gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
- Xilinx Constraint Study Notes - Timing Constraints
- HCIP 第八天
- (2022 Niu Ke Duo School 5) D-Birds in the tree (tree DP)
- 读入、输出优化
- 用户身份标识与账号体系实践
猜你喜欢
A full review of mainstream timed task solutions
Probability Theory and Mathematical Statistics
PanGu-Coder: A function-level code generation model
有点奇怪!访问目的网址,主机能容器却不行
Kind of weird!Access the destination URL, the host can container but not
Aided by training and learning by battle | The new version of the Offensive and Defense World Platform is officially launched!
2022-2023 十大应用开发趋势
FormData upload binary file, object, object array
MySQL error 1055 solution: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
pnpm install出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
随机推荐
CollectionUtil: a collection of functional style tool
Probability Theory and Mathematical Statistics
MGRE环境下的OSPF
Splunk Filed Alias field name
爬虫 视频爬取工具you-get
Install Metasploitable2 on VMware
HCIP 第十天
Conditional constructor ~wapper
Thesis understanding: "Cross-Scale Residual Network: A GeneralFramework for Image Super-Resolution, Denoising, and "
Inverter insulation detection detection function and software implementation
Control 'ContentPlaceHolder1_ddlDepartment' of type 'DropDownList' must be placed inside a form tag with runat=server.
HCIP 第六天
读入、输出优化
基本SQL语句(一篇就够了)
LeetCode刷题(7)
[mixed] PIP in domestic source tutorial and domestic source address
Postgres horizontal table, automatically create partitions, table by time
MySQL - Index Optimization and Query Optimization
Splunk Filed extraction field interception
2022年防止网络攻击的15个网络安全实践,你学会了吗?