According to http spec header should be single line string without any special characters: https://tools.ietf.org/html/rfc2616#section-4.2 With that in mind Base64 seems to be solution to prevent from accidental spaces or anything else that will break header. Spreading across different headers will be also good idea, but I'm not sure if payload in the future will grow into some nested objects that may overcomplicate implementation on client and server. I do not have strong opinion, but from all options mentioned Base64 seems to be the fastest aproach. |