Using a Xojo.Net.HttpSocket I have the following wired problem:
Works fine in Mac but not in Windows
I first send a GET request to obtain a Authorization Token and then I send a POST request placing the Authorization token in the Header
Var strMyAccessToken as string = "Bearer " + strAccessToken
Var textAccessToken as text = strAccessToken.totext
MySocket.RequestHeader(“Authorization”) = textAccessToken
Var data As Xojo.Core.MemoryBlock = Xojo.Core.TextEncoding.UTF8.ConvertTextToData(MyJson)
MySocket.SetRequestContent(data,“application/json”)
MySocket.Send(“POST”, MyUrl)
What I am asking is if there is something to consider that makes my code works different when running a Windows or a Mac compilation, so the webservice invoked receive an invalid access token in one case. The Access token is passed in the header of the message, an the header is created with the same code for both a windows app and a mac app.
Just for the records:
In windows, prior to this line of code:
MySocket.RequestHeader(“Authorization”) = textAccessToken
you have to
MySocket.ClearRequestHeaders
I don´t know why this line of code is not necessary in Mac.