I’ve been using an old framework HTTPSecureSocket in a program without trouble. I moved the routine into a thread and now it returns [quote]404 Bad Request[/quote] instead of a JSON string. My code is:
Dim socket1 As New HTTPSecureSocket
socket1.Secure = True
socket1.Yield = True
dim a As String = "https://ezmeter.net/md.php?s=" + me.SerNum + "&j=1"
dim b As Integer = socket1.ErrorCode
Dim jsonData As String = socket1.Get(a, 5)
When I paste the “a” string into my browser (with me.SerNum = 67530) , it returns the JSON string expected. The error code returns 0. I have also set the socket timeout to 30 without any change. Xojo 2018r4 and 2017r2.1 both have the same result.
Thank you Tim. It works perfectly in your thread. I swapped out the HTTPSecure Socket for a URLConnection and that works too. The problem with that is I don’t have the license for 2018r4 and the company hasn’t budgeted it and the MBS plugins this year. Perhaps this is one of those weird situations where retyping the same code will fix the problem.
it is very nice (or will be). I am using it in a few smaller apps right now. Once 2019r1 comes out (or maybe R2) it will get some more love and finish the basics functionality that we all expect of it. And at that point some/most of us will start depreciating using HTTP*Socket and xojo.net.httpsocket.
I am using URLconnection in a thread in a small app I wrote for a friend that parses an API. works like a champ.