Td: Passing "bytes" type with json api

Created on 3 Mar 2018  路  6Comments  路  Source: tdlib/td

bool object fields are stored as Booleans in JSON. int32, int53 and double fields are stored as Numbers. int64 and string fields are stored as Strings. vectors are stored as Arrays.

bytes type is not documented. Is it possible to pass bytes with JSON API?

Most helpful comment

Bytes should be encoded/decoded with plain base64, not with base64url, but they are definitely supported and will be mentioned in the documentation.

All 6 comments

I think it's worth a try.

I mean what JSON type should I use to serialize/deserialize bytes?

String. But let's wait for the answer of more qualified specialists.

Yes it is possible, bytes will be automatically encoded and decoded with base64url and sent as a string.

Great! Thanks!

Bytes should be encoded/decoded with plain base64, not with base64url, but they are definitely supported and will be mentioned in the documentation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pishnok picture pishnok  路  3Comments

mbj2007 picture mbj2007  路  4Comments

hameda169 picture hameda169  路  3Comments

Losses picture Losses  路  3Comments

RadRussianRus picture RadRussianRus  路  3Comments