Jacek Laskowski 57 Posted Wednesday at 02:56 PM Does the REST library built into delphi allow multiple requests to run in parallel on a single TRESTClient? The way you use this library is that you create an instance of TRESTClient: fClient := TRESTClient.Create(aBaseURL); And then at runtime when there is a need to execute a request you create TRESTRequest, TRESTResponse and call Execute() on TRESTRequest, in short: fRequest := TRESTRequest.Create(nil); fRequest.Client := fClient; fRequest.Resource := aEndpointData.Endpoint; fRequest.Method := aEndpointData.HTTPMethod; fResponse := TRESTResponse.Create(nil); fRequest.Response := fResponse; fRequest.Execute(); That is, each request has a new TRESTRequest and a new TRESTResponse, but the same TRESTClient. So is it allowed to execute simultaneously (e.g. in a thread) several requests on the same TRESTClient? Share this post Link to post
Dalija Prasnikar 1567 Posted Wednesday at 06:39 PM 3 hours ago, Jacek Laskowski said: Does the REST library built into delphi allow multiple requests to run in parallel on a single TRESTClient? No. You need separate client for each request if you want to run them in parallel. 1 Share this post Link to post
Jacek Laskowski 57 Posted Thursday at 05:29 AM 10 hours ago, Dalija Prasnikar said: No. You need separate client for each request if you want to run them in parallel. It's a bit sad. Too bad. Thanks. Share this post Link to post