阅读背景:

是否有一种方法可以从http响应中提取JSON,而不必构建结构体?

来源:互联网 

All of the ways I'm seeing involve building structs and unmarshalling the data into the struct. But what if I'm getting JSON responses with hundreds of fields? I don't want to have to create 100 field structs just to be able to get to the data I want. Coming from a Java background there are easy ways to simply get the http response as a string and then pass the JSON string into a JSON object that allows for easy traversal. It's very painless. Is there anything like this in Go?All of the ways I'm seeing involve building str




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: