Passing as JSON Object vs Passing as jSON string for HTTP service

Viewed 20

I'm building a HTTP service that sends a JSON as a response. I'm trying to figure out which one is better, sending the JSON as a JSON object or as a JSON string. I found out that using the JSON string, the size of the payload is much smaller than the JSON object. Any pros and cons on using each of them? Thank you

Edit

What I mean with JSON Object is like this

{"firstName":"John", "lastName":"Doe"}

,while JSON string (stringified JSON) is like

`{"firstName":"John", "lastName":"Doe"}`
0 Answers
Related