Blueforcer Well-Known Member Licensed User Longtime User Mar 12, 2018 #1 im trying to send an INT Array (PixelColors(64) As Int) to my B4J server, wich put them into a SQL db. i use HttpJob funktion to send the informations. But i dont know how to send this array with the Post method. I cant declare the PixelColors as an byte array because it contains Int colors with huge numbers. e.g 10046822
im trying to send an INT Array (PixelColors(64) As Int) to my B4J server, wich put them into a SQL db. i use HttpJob funktion to send the informations. But i dont know how to send this array with the Post method. I cant declare the PixelColors as an byte array because it contains Int colors with huge numbers. e.g 10046822
DonManfred Expert Licensed User Longtime User Mar 12, 2018 #2 put your data into an array and add it to a json-generator. Send the json-string and parse it back on the serverside... Or generate a long string with all the numbers sperarated by komma. Upvote 0
put your data into an array and add it to a json-generator. Send the json-string and parse it back on the serverside... Or generate a long string with all the numbers sperarated by komma.
Erel B4X founder Staff member Licensed User Longtime User Mar 12, 2018 #3 B4XSerializator is the best option for such tasks. However it doesn't support arrays of ints. You should convert the array to a list: Code: Copy Dim list As List = PixelColors Dim ser As B4XSerializator Dim b() As Byte = ser.ConvertObjectToBytes(list) You can then get it back as a list on the other side. Upvote 0
B4XSerializator is the best option for such tasks. However it doesn't support arrays of ints. You should convert the array to a list: Code: Copy Dim list As List = PixelColors Dim ser As B4XSerializator Dim b() As Byte = ser.ConvertObjectToBytes(list) You can then get it back as a list on the other side.