Hi,
I have a rest api (json) for an invoice app.
When an invoice it is generate in the app, I need to send it for printer in the server.
The invoice it is an stringbuilder.
I am trying to send the stringbuilder with PostBytes, but it arrives empty or the string.
This example arrive with value=null to rest api bytearray but int the log request in the server, show "Hello word"
But if I coment the line
the value it is Byte[0] of the byteArray.
Any have any Idea of how solve this issue?
Others clients of the rest api in C# work well.
I have a rest api (json) for an invoice app.
When an invoice it is generate in the app, I need to send it for printer in the server.
The invoice it is an stringbuilder.
I am trying to send the stringbuilder with PostBytes, but it arrives empty or the string.
B4X:
Dim j As HttpJob
j.Initialize("SubirImagenTicket",Me)
Dim printimagen() As Byte="Hello word".GetBytes("UTF8")
j.PostBytes(clParametros.URLApi & apiUrl, printimagen)
j.GetRequest.SetContentType("application/json")
j.GetRequest.Timeout=60000
j.GetRequest.SetContentEncoding("UTF8")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim parser As JSONParser
parser.Initialize(j.GetString)
Log(j.GetString)
Dim root As Map = parser.NextObject
Dim CodigoError As Int = root.Get("CodigoError")
If (CodigoError=0) Then
EjecucionOk=True
End If
Else
Log ("Error:" & j.ErrorMessage)
End If
j.Release
This example arrive with value=null to rest api bytearray but int the log request in the server, show "Hello word"
But if I coment the line
B4X:
j.GetRequest.SetContentType("application/json")
Any have any Idea of how solve this issue?
Others clients of the rest api in C# work well.