Hi All
I started working on the API connection using Xojo.Net.HTTPSocket to connect with Saasu accounting software & have run into a problem.
Using this code
// Self is the Xojo.Net.HTTPSocket
Self.ClearRequestHeaders
Dim requestContent As Text = Session.spsAPIRequestContent.ToText
If Not requestContent.Empty Then
Dim data As Xojo.Core.MemoryBlock
data = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(requestContent)
Self.SetRequestContent(data, “application/json”)
End If
Self.Send(“POST”, Session.spsAPIRequestURL.ToText)
I am getting back a response & access token as I would expect. However, in the PageReceived event, after processing the access token, I use this code…
dim ptContent As String = kGetContacts
ptContent = ptContent.Replace("^1", mpsAccessToken)
Dim requestContent As Text = ptContent.ToText
If Not requestContent.Empty Then
Dim data As Xojo.Core.MemoryBlock
data = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(requestContent)
Self.SetRequestContent(data, “application/json”)
End If
Self.Send(“GET”, Session.spsAPIRequestContactsURL.ToText)
which errors with a A request is already in progress.. I moved that code into a timer on the page & it runs, but I get an "The network connection was lost. error & no return data.
This problem is the same on both a web & desktop app.
Am I doing something wrong, or is there bug in Xojo.Net.HTTPSocket?
Regards
Chris Percival