Skip to content

请教一下调整输出JSON的具体格式 #5

Description

@missyoyo

作者你好,我最近测试了你的API,感觉总体来说非常好,不过你的API输出格式中JSON包含了本身输入的IP地址做为字段,这样在解析的时候会生成动态字段名,举个例子,如果我输入114.114.114.114,
http://127.0.0.1:2060/?ip=114.114.114.114
得到的结果是:
{"114.114.114.114":{"ip":"114.114.114.114","country":"江苏省南京市","area":"南京信风网络科技有限公司GreatbitDNS服务器"}}
进行解析后得到结果:
图片
请教一下源代码中的源个部分能做一下小调整,使用输出结果只保留country和areap字段
例如如下简单的输出结果:
{
"ip": "114.114.114.114",
"country": "江苏省南京市",
"area": "南京信风网络科技有限公司GreatbitDNS服务器"
}
非常感谢。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions