hello,
i will send bytes from a client app to my server but at receive i got error
java.util.zip.ZipException: unknown compression method
Obj = ser.ConvertBytesToObject(buffer)
Client:
jServer:
i will send bytes from a client app to my server but at receive i got error
java.util.zip.ZipException: unknown compression method
Obj = ser.ConvertBytesToObject(buffer)
Client:
B4X:
Sub Save(Item As SinglePassword)
Dim Data() As Byte
Dim ser As B4XSerializator
Data = ser.ConvertObjectToBytes(Item)
Dim Job As HttpJob
Job.Initialize("",Me)
Job.Username = Main.Username
Job.Password = Main.Password
Job.PostBytes("https://" & Main.Server & "/request/save",Data) '?cmd=save
Wait For (Job) JobDone(Job As HttpJob)
If Job.Success Then
Else
xui.MsgboxAsync("Save Failed","Error")
End If
Job.Release
End Sub
jServer:
B4X:
srvr.AddHandler("/request/save", "Save", False)
Sub Handle(req As ServletRequest, resp As ServletResponse)
Log(req.FullRequestURI)
Dim ser As B4XSerializator
Dim Obj As Object
Dim buffer(req.InputStream.BytesAvailable) As Byte
Obj = ser.ConvertBytesToObject(buffer)
Dim Item1 As SinglePassword
Item1 = Obj
Dim Manager As PasswordManager
Manager.Initialize
Manager.Save(Item1)
resp.Write("ok save " & Item1.Id & " " & Item1.Name)
End Sub