Dumb question. Is anyone using the new Xojo.Net.HTTPSocket class in cross platform applications? I develop on OS X and it works stellar there. In Linux it’s gives weird results and on Windows it seems to not work at all.
In Linux it appears that perhaps that SetRequestContent doesn’t work as it should since the data is never received by the web app. Well, the key is there but the value is always blank. Here’s the code
dim d as new xojo.Core.Dictionary
d.value("Username") = "Bob"
d.value("Password") = "Keeney"
dim s as text = xojo.Data.GenerateJSON(d)
dim data as xojo.Core.MemoryBlock = Xojo.core.TextEncoding.UTF8.ConvertTextToData(s)
oSocket.SetRequestContent(data, "application/json")
oSocket.Send("POST", sURL + "Login")
In Windows, the Send just goes into oblivion. No error message. No exceptions. Just…nothing.
Very frustrating to get such vastly differing results. Any ideas or observations on the new HTTPSocket??
I submitted a private bug report. I narrowed it down (in Windows at least) to the xojo.net.httpsocket either being in a thread or being subclassed. In a much smaller, simpler project I was able to get a runtime error.
Either way it screws this project over. Waiting on client decision to go to old socket or to CURL.
There is a GlueKitHTTPSocket in there that is a drop in replacement for Xojo.Net.HTTPSocket. It’s cross-target aware so on iOS it uses Xojo.Net.HTTPSocket and on Desktop/Console it uses HTTPSecureSocket. This way you don’t have to break everything relying on Xojo.Net.HTTPSocket and you can sub it out when the issue is resolved @ Xojo.