Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_msgpack
decode_to_json/1
Description
decode_to_json/1 is an Erlang function exported by "age_msgpack" module.
Decodes MessagePack data into string in JSON format.
References
•encode_from_json/1
Parameters
Name
Type
Data
binary()
Input data in valid MessagePack format.
Result
Value or Type
string()
Returns string in JSON format.
Code Sample
> Message = <<130,162,102,49,203,64,41,0,0,0,0,0,0,162,102,50,164,84,101,115,116>>. > age_msgpack:decode_to_json(Message). "{\"f1\":12.5,\"f2\":\"Test\"}"