Greetings!
I am using URLConnection to query the status from a camera.
No authorization is required, and on postman desktop app it sends and receives the JSON without problems.
BUT on Xojo, I am getting “Error occurred while sending request (likely a bad url)” in the “Error” event handler.
mConnection on Window as URLConnection
Any suggestions?
Code on button below
var json as Dictionary = new Dictionary
var params as Dictionary = new Dictionary
params.value("timeout")= 20
json.Value("apiVersion") = "1.1"
json.Value("context") = "83"
json.Value("method") = "systemready"
json.Value("params") = params
var jsonData as String = GenerateJSON(json)
'returns {"apiVersion":"1.1","context":"83","method":"systemready",'params”:{“timeout”:20}}
var camUrl as String
camUrl = "https://192.168.1.223/axis-cgi/systemready.cgi"
system.DebugLog(camUrl)
try
mConnection.RequestHeader("Content-Type") = "application/json"
mConnection.RequestHeader("Accept")="*/*"
mConnection.RequestHeader("Connection")="keep-alive"
mConnection.SetRequestContent(jsonData,"application/json")
mConnection.Send("POST",camUrl,10)
catch e as NetworkException
system.DebugLog(e.Message)
end