getting JSON data in much smaller way.
-
Normally JSON data is fetched in the following form from Web API etc. [ {"name" : "Steve", "Age": 76}, {"name": "Jeremy", "Age": 43} ] You can see that "name" and "Age" is repeating with every column. But I've seen a service getting data in this fashion. Which really shorten the JSON object something like that. [ columns: {"name", "age"} data: {"Steve",76},{"Jeremy",43} ] How to do it?
-
Normally JSON data is fetched in the following form from Web API etc. [ {"name" : "Steve", "Age": 76}, {"name": "Jeremy", "Age": 43} ] You can see that "name" and "Age" is repeating with every column. But I've seen a service getting data in this fashion. Which really shorten the JSON object something like that. [ columns: {"name", "age"} data: {"Steve",76},{"Jeremy",43} ] How to do it?
-
well, you can tweak the Json a little,
{
"name" : ["Steve", "Jeremy"],
"Age": [76,43]
}looks greatly shortened..
But you lost all the good in JSON... I would say that compressing the traffic will do better...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
But you lost all the good in JSON... I would say that compressing the traffic will do better...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Is there a good tutorial on compressing the traffic on JSON data.
-
Is there a good tutorial on compressing the traffic on JSON data.
It is a definition of your web server IIS/Apache or whatever you use... In IIS for instance there is a compression icon you can use...https://technet.microsoft.com/en-us/library/cc771003%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396[^]
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.