I am trying to send a post request with a bitmap in the body. With the following code I tried, the received request on the server side is empty. Anyone knows why?
B4X:
Dim bt as bitmap =loadbitmap(file.dirinternal, "testing.jpg")
Dim out as outputstreaam
out.initializeToBytesArray(0)
bt.writetoStream(output,100,"JPEG")
Dim j as httpjob: j.initialize("",me)
Dim url as string =
j.postBytes(url, out.ToBytesArray)
Dim bt as bitmap =loadbitmap(file.dirinternal, "testing.jpg")
Dim out as outputstreaam
out.initializeToBytesArray(0)
bt.writetoStream(output,100,"JPEG")
Dim data() As Byte = File.ReadBytes(File.DirAssets, "testing.jpg")
job.PostBytes( url, data)
plus i have no idea what your server is doing, but try the above. my server reports on the bytes received (attached) ...
adding a content type header wouldn't hurt.
Dim data() As Byte = File.ReadBytes(File.DirAssets, "testing.jpg")
job.PostBytes( url, data)
plus i have no idea what your server is doing, but try the above. my server reports on the bytes received (attached) ...
adding a content type header wouldn't hurt.