Friday, February 11, 2022

Json - Array type element formats | Sample json payloads

Here , you can see a sample array type employee element having fname, lname and dept details.

Json format 1:

[

{"Fname":"","Lname":"","Dept": ""},

{"Fname":"","Lname":"","Dept": ""}

]

Json format 2:

{"employees":[    
{"name":"sri", "email":"sri@gmail.com", "age":23},    
 {"name":"sand", "email":"sand@gmail.com", "age":28},  
{"name":"dip", "email":"dip@gmail.com", "age":33},    
{"name":"Bob", "email":"bob32@gmail.com", "age":41}   
]}  


Json format 3: most understandable format:

{

"Employees":{

"Employee":[    
{"name":"sri", "email":"sri@gmail.com", "age":23},    
 {"name":"sand", "email":"sand@gmail.com", "age":28},  
{"name":"dip", "email":"dip@gmail.com", "age":33},    
{"name":"Bob", "email":"bob32@gmail.com", "age":41}   
]

}  

}


No comments:

Post a Comment

Featured Post

OIC - difference between SOAP and REST

Difference between SOAP and REST: SOAP (Simple Object Access Protocol) Protocol : A strict protocol for message exchange with built-in stand...