B4J Question Send HTTP POST request with multiple answers

CR95

Active Member
Licensed User
Hello,
I would like to connect my B4J Client program to a box on the same LAN (this client is running today on Windows and later will be on a Raspberry).
Specifications of dialog with the box are clear, but one of them is an issue as there are several answers (depending on the user who has to click on a button on the box to authorize the request)
Because (I presume) there will be multiple sequential responses, I do not use the "Wait For (SendHTTPPost(url, data)) complete (Response As String)" as in the previous exchanges.
My understanding is that only works for one (immediate) unique response.
That is why I use the following code :
The unique response that is received is following error
Yes. My program is waiting for a JSON string !
Please could you tell me if my process is the good one.
If yes, what should I do to get the good answer ?
Thanks for your help
 

rosippc64a

Active Member
Licensed User
Longtime User
try instead of
B4X:
Dim Parser As JSONParser
Parser.Initialize(job.Response)
this:
B4X:
Dim Parser As JSONParser
Parser.Initialize(job.Getstring)
 
Upvote 0

CR95

Active Member
Licensed User
Thanks for your answer.
Yes, by applying your suggestion, I get now a "pending" response from the server.
Then I run to my box and I click on the button to finish the authorization process.
But nothing happens. It seems that my program does not receive the following response (which should be "granted").
My understanding was that a new event will fire the sub "jobdone" without additional code. It seems that I am wrong
Do I have to resend a complete request (httpjob initialize/ download / jobdone....) in order to get the second response ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…