我有以下json响应
{
"tag": [
{
"listing_count": 5,
"listings": [
{
"source": "source1",
"data": {
"image": "image1",
"name": "name1"
},
"name": "name1"
}
]
},
{
"listing_count": 5,
"listings": [
{
"source": "source2",
"data": {
"image": "imag2",
"name": "name2"
},
"name": "name2"
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
我为GSON请求创建了以下类.如何使用排球请求发出GSON请求并存储响应的值.GSON请求应该是什么样的?
public class TagList {
ArrayList<Tag> tags;
public static class Tag {
int listing_count;
ArrayList<Listings> listings;
public int getListing_count() {
return listing_count;
}
public void setListing_count(int listing_count) {
this.listing_count = listing_count;
}
public ArrayList<Listings> …Run Code Online (Sandbox Code Playgroud) 我总是读到数据来自json格式的服务器,当我们想要发送一些我们以json格式发送到服务器的数据时,数据以json格式传输,然后字符串请求来自哪里?我不知道我们是否也能以字符串格式发布和获取数据,使用字符串和json请求有什么区别和用例?
谢谢!