When I use URLConnection I get this error: "application has gone off-line".
I created a clsCallHTTP class as super URLConnection.
The clsCallHTTP class has:
>> a property called iTimeOut or ftype Integer
>> a property called sResult of type String
>> a method called PostHTTP with this code inside:
Public Sub PostHTTP(sURL as string) Self.sResult = "" Self.sResult = Self.SendSync("POST", sURL, Me.iTimeOut) End Sub
>> a Event Handlers ContentReceived with this code:
Sub ContentReceived(URL As String, HTTPStatus As Integer, content As String) Handles ContentReceived self.sResult = content End Sub
Then I have a WebDialog called wDoc which has a cHttp property of type clsCallHTTP.
In a button of this WebDialog I call my method in this way:
Dim URL as string = "https://www.domain.com/api/v0.3/SaveDocument" Dim sDATA as string = "apiKey=myapikey&xml=myxmldata" cHttp = New clsCallHTTP cHttp.iTimeOut = 30 cHttp.RequestHeader("Content-Type") = "text/html;charset=UTF-8" cHttp.SetRequestContent(sDATA, "application/x-www-form-urlencoded") cHttp.PostHTTP(URL) Do Until cHttp.sResult <> "" 'whait Loop Dim postResponse As String = "" postResponse = cHttp.sResult
When I use it in local debugging, both Windows and MacOS, it works. When I compile it and publish it on my Linux server it doesn't work.
The application works for all features, such as: reading and writing to MySQL, opening the Map, etc. But when I call the PostHTTP method of class clsCallHTTP the application go off-line.
Why in Debug work and compiled doesn't work?
Have to enable something on my Linux server?