I have an external process that returns to me a proper JSON (call it R) as a binary:
R = some_func(),
erlang:display(R),
{200, {json, R}, State}
displays
<<"{\"fulllist\": \"True\"}">>
However, using the code above, what actually gets returned to the client looks like the above, because it is doubly encoded because I think you always call jiffy:encode. So what the client actually gets is:
<<"{\"fulllist\": \"True\"}">>
I would like to request an optional "do not reencode" flag somehow.
As a hack, for now, what I am doing is calling a decode first since it gets reencoded:
R = ...
erlang:display(R),
V = jiffy:decode(R),
{200, {json, V}, State}
I have an external process that returns to me a proper JSON (call it
R
) as a binary:displays
However, using the code above, what actually gets returned to the client looks like the above, because it is doubly encoded because I think you always call
jiffy:encode
. So what the client actually gets is:I would like to request an optional "do not reencode" flag somehow.
As a hack, for now, what I am doing is calling a decode first since it gets reencoded: