3 ms·
Sorry, it seems like you're dug in on this, but you're forcing clients to deserialize enormous object graphs just to figure out if there was a failure or not.
by sk5t 5y ago
Sorry, it seems like you're dug in on this, but you're forcing clients to deserialize enormous object graphs just to figure out if there was a failure or not. This is "surprising" behavior. A better designed system would use the HTTP status code, status reason, and perhaps an additional header to convey important high-level information.
- shroompasta 5y agoclients don't deserialize json. object graphs should be just called json or response body; you shouldn't use all these unorthodox terms. a failure will be caught if a 400 was sent. This is how axios works - if you try a request, a 400 will automatically hit the catch. a better designed system would be specificity. 75-90% of the time you're most likely going to look at the error body anyways.
- sk5t 5y ago> clients don't deserialize json. I mean no personal offense but this is one of the most baffling and/or ignorant responses one could have imagined in this case.
- shroompasta 5y agoa simple architecture json data => python server => redis - json data gets serialized from json to string in the python server - python server then stores that string in redis to request from python server - string is retrieved from redis server - string is deserialized to send response as json the Web client is in Javascript JSON is native to Javascript it is already readable to the client, there is no deserializing that needs to happen.