I moved from Indy components to SecureBridge components. At the moment I try to setup a simple HTTP connection and retreive some data. After running my code (without the ''disconnect()' function), it is not possible to execute the same code multiple times. I receive an error message "Project Project1.exe raised exception class HttpException with message 'The operation is not allowed when the request is executed'.". After adding 'disconnect()' to the end of the code, it is possible to execute the code multiple time. I am wondering if it is correct to call 'disconnect()'. Is there another way? Maybe to keep the connection open or alive?
Below you find my code.
Code: Select all
ScHttpWebRequest1->RequestUri = "https://my-url.com";
ScHttpWebRequest1->Method = rmGET;
TScHttpWebResponse *ScHttpWebResponse1 = ScHttpWebRequest1->GetResponse();
Memo1->Text = ScHttpWebResponse1->ReadAsString();
ScHttpWebRequest1->Disconnect();