0
Body 传参时,有没有必要将查询参数用一个字段包起来
source link: https://www.v2ex.com/t/1023889
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
例如:
POST /api/client
1. Body 参数
{
pageIndex:1,
pageSize:10,
area:123,
type:1,
star:1
}
2. Body 参数
{
pageIndex:1,
pageSize:10,
pBody:{
area:1,
type:1,
star:1
}
}
哪种方式比较好,我知道都可以,只是习惯问题,但是应该是有一些历史遗留原因或者道理的,可能是语言间的开发差异导致,可能是开发人员的习惯导致,可能是由。。。。。。。
请问 V 友们你们更倾向于哪种方式,原因是什么
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK