Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sanitized, well formed JSON is generally not horribly URL encoded. It's typically less overhead than base64.

Also, for well formed JSON (not arbitrary JSON), it also works fine in HTTP headers. I think those two situations cover about 90% of use cases.

For example, here is a JSON payload URL encoded. It's not too bad, and much better than base64:

https://cyphr.me/coze#?input={%22pay%22:{%22msg%22:%22Hello%...

The initial payload is 238 bytes, URL encoded that payload is 288 bytes, as base 64 it is 318 bytes. (Here's another tool just for that: https://convert.zamicol.com/#?inAlph=text&in=%257B%2522pay%2...)



I'd rather try to build systems that always work, rather than only working for well-formed inputs transmitted over well-behaved mediums.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: