What's the best way to send binary data in a JSON command parameter ?
Do I have to base64 encode it or is there some better way ?
In that case, is there some base64 encoding function available in the lua libraries bundled with Squeezeplay ?
I'm making the call from a lua applet, so I have to be able to encode it using lua.
I want the binary information to be transfered from the applet running in Squeezeplay to a plugin in SBS.
Results 1 to 4 of 4
-
2010-03-04, 00:17 #1
Sending binary data in JSON commands ?
Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.
-
2010-03-04, 04:05 #2
Binary data is not supported in JSON, so, yes, I think you will need to base64 encode the data.
There are some LUA base64 libs, e.g.
http://lua-users.org/wiki/BaseSixtyFour (LGPL)
But I've not used them on my own, so I can't tell you if they work as expected.
-
2010-03-04, 11:37 #3Senior Member
- Join Date
- Apr 2005
- Posts
- 6,932
Sending binary data in JSON commands ?
There's already a base64 support in the lua mime library. I use it all the
time...
>> I want the binary information to be transfered from the applet running
>> in Squeezeplay to a plugin in SBS.
>
> Binary data is not supported in JSON, so, yes, I think you will need to
> base64 encode the data.
>
> There are some LUA base64 libs, e.g.
> http://lua-users.org/wiki/BaseSixtyFour (LGPL)
>
> But I've not used them on my own, so I can't tell you if they work as
> expected.
-
2010-03-04, 12:33 #4Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.

Reply With Quote

