URLConnection on web

Hello Guys,

Is URLConnection working on web ?

i try to get a simple url response , i do a webdialog where i define the URLConnection property and i call it like this

If taSource.Text <> "" Then
  
  conn = New URLConnection
  
  taResponse.Text = conn.SendSync("GET", taSource.Text, 30)
  
  taResponse.Text = taResponse.Text + EndOfLine + "Connection Status code : " + conn.HTTPStatusCode.ToString
  
  conn.Disconnect
  
  conn = Nil
  
  
End If

Now, once i run this locally on the mac it works perfectly . When i run that on the debian server it crashes and it says that the app needs to restart .

Any idea why ?

Thanks

Try:

taResponse.Text = conn.SendSync("GET", taSource.Text, 30)

Sorry that was a typo, SendSync was the code as Send requires a folderitem as output but so far it fails on linux

Remove the call to disconnect. You don’t need that. I would also comment out the call to make it nil. Chances are you don’t need that either.

In terms of your crash, do you have code in App.UnhandledException to see if you’re just getting an exception over there? Or even better, use the remote debugger to run your code on that server and see what the actual problem is.

You may need to install

libsoup2.4-1

1 Like

works perfectly, thanks