For each value, the first byte represent the type of the value. Since the response is highly compressed, each valuetype can have multiple types
Code | Description |
0 | 1 byte len string, type is followed by 1 byte indicating string length and then by the string itself |
1 | 2 byte len string.... |
2 | 3 byte len string.... |
3 | 4 byte len string.... |
Reused string types: [150,199] - for string ids between 0 and 49 id is directly encoded in type
Code | Description |
4 | 1 byte string id follows type |
5 | 2 byte string id follows type |
6 | 3 byte string id follows type |
7 | 4 byte string id follows type |
Code | Description |
8 | 1 byte number follows |
9 | 2 byte number follows |
.... | |
14 | 7 byte number follows |
15 | 8 byte number follows |
Code | Description |
18 | false |
19 | true |
Name
Array
Type
17
Description
Arrays are represented as unspecified number of values, ending with value of type 255
Name
Hash
Type
16
Description
Hashes are represented as unspecified number of pairs of values, ending with value of type 255. First value of the pair is the key and second is the value of the given entry in the hash table. The key is always string value.
Name
Data
Type
20
Description
Followed by 8 byte number that indicates how much data the server is sending after the response to this request (that is the data starts after the 4 byte length is read from the server)
Note: The first value you get is always of type hash. This is the same hash you get as JSON result that is it will always have key result with number value and optionally other keys and values, described in the descriptions of the methods.