Hi,
In C# to send the bytearray I call:
to create the array:
byte[] invoice=Encoding.Default.GetBytes(sb.ToString());
to send by call api rest
HttpResponseMessage response = await client.PostAsJsonAsync(apiurl, invoice);
and arrive to server something this:
application/json; charset=utf-8 "G0AbYQFJTk5URUdSQUNPTSBTLlIuTC4KSU5OVEVHUkEgU09GVFdBUkU...
the length of the array are aprox. 1500 bytes and the api rest
the api uri it is:
[HttpPost]
public IHttpActionResult PostNewPrintImage(string apikeytoken, byte[] value)
With C# work well, but from Android I am trying:
for example, to create a test bytearray with some words.
Dim printimagen() As Byte="Hello word".GetBytes("UTF-8")
-Send by PostBytes EJ:
j.PostBytes(clParametros.URLApi & apiUrl,printimagen)
j.GetRequest.SetContentType("application/json; charset=utf-8")
but to the server arrive: application/json; charset=utf-8 Hello word
And the api post value it is byte[] value=null
-Send by saving file to disk and send by PostFile, the same result.
-Send by JSONGenerator in a map, by PostString and arrive:
application/json {"DocInvoice":[24,27,64,27,107,50,32,32,32,32,...]}
In this case changed the parameter to receive this objet in the rest api, and work well if the array it is shot, I do not know in some cases the array it is truncate and fail to recive.
Well I still working int options....