This is my code to get a json string that works ok on my local network if i previously logged in locally (In Chrome for example).
But in order to work without login in a browser i need to set a cookie first. How can i do that?
How can i set a Cookie then save it and reuse in every next downloads?
This is my current code:
B4X:
Dim job As HttpJob
If Not (job.IsInitialized) Then
job.Initialize("GET_DEVICES", Me)
End If
job.Download(Server & "/api/v2/devices/1")
job.GetRequest.Timeout = 6000000
This is the API documentation in order to login with cookies:
Ok but in this case i need to download the 192.168.0.62/api/v2/login pass parameters as json/text, then get the response in job_done and then setHeader in next downloads?