将json请求体转换为x-www-form-urlencoded。

问题描述 投票:0回答:1

如果我们有一个json内容类型的请求,如下所示。

{"name":"user","var":"foo"}

相当于 x-www-form-urlencoded 将是 name=user&var=foo

那么,什么将是相当于 x-www-form-urlencoded 为。

{"name":"user","details":{"phone":"123","city":"newyork"},"Items":["123","456"]} 

谢谢。

json api content-type x-www-form-urlencoded
1个回答
0
投票

你给出的例子中,你的urlencoded是这样的。

name=user&details[phone]=123&details[city]=newyork&Items=123,456。

© www.soinside.com 2019 - 2024. All rights reserved.