How do I postbytes using httputils2 please. I have been stepping through the flicker tut and adapting it to learn from it but am stuck. I want to do a post request.
The Link has been formed into a bona fide url . The Text as string has been processed through Text.Bytes("UTF8") All this has been passed to
B4X:
Public Sub PostBytes(Link As String, Data() As Byte)
mLink = Link
req.InitializePost2(Link, Data)
CallSubDelayed2(HttpUtils2Service, "SubmitJob", req)
End Sub
Now when I go to amend
B4X:
Public Sub SubmitJob(job As HttpJob) As Int
End Sub
I am stuck. Instead of
B4X:
hc.Execute(job.GetRequest, taskCounter)
I want to
B4X:
hc.Execute(job.PostBytes
As far as I can tell job.PostBytes wants a Link as a string and Data as a byte array. But these have not been passed to the sub SubmitJob. Please Help. Many thanks.
Well I've sort of got it. I understand now that the url and the text data are wrapped in the req wrapper and that is passed to the sub SubmitJob as an http request.
If I hard code everything into the url it all gets posted and the result string is as expected.
But. If I try and send it as url and text data that is
Well I need to alter something, because in the given example, flkr, the sub SubmitJob seems only to be executing get jobs and I am trying to learn how to use httpsutils2 to execute post jobs, but so far to frustratingly little effect, but what it is I need to change or add remains a mystery.