项目作者: xuwei-k

项目描述 :
web api for convert msgpack <=> json
高级语言: Scala
项目地址: git://github.com/xuwei-k/msgpack-json.git
创建时间: 2015-01-27T12:55:52Z
项目社区:https://github.com/xuwei-k/msgpack-json

开源协议:

下载


msgpack-json

example

msgpack binary data => json string

  1. $ scala -e 'java.nio.file.Files.write(new java.io.File("msgpack_data1").toPath, Array(0x81, 0xa3, 0x61, 0x62, 0x63, 0x92, 0xc2, 0x2a).map(_.toByte))'
  2. $ curl -X POST -d @msgpack_data1 https://msgpack-json.appspot.com/msgpack2json
  3. {"abc":[false,42]}

json string => msgpack binary data

  1. $ curl -X POST -d '{"abc":[false,42]}' https://msgpack-json.appspot.com/json2msgpack > msgpack_data2
  2. $ scala -e 'println(java.nio.file.Files.readAllBytes(new java.io.File("msgpack_data2").toPath).map("%02x" format _).mkString(","))'
  3. 81,a3,61,62,63,92,c2,2a