0

我知道您可以[xml_root_name][1]在使用 XML 时使用。有没有办法用 JSON 来完成这个?

目前我的 XML 如下所示:

<user id="13">
    <username>dadams</username>
    <email>email@example.org</email>
</user>

我有以下 JSON:

{
    "id": 13,
    "username": "dadams",
    "email": "email@example.org"
}

当我真的想要这个时:

{
    "user": {
        "id": 13,
        "username": "dadams",
        "email": "email@example.org"
    }
}
4

0 回答 0