In your assembly for .NET, there is a method named InvokeApi
that sends a request in a synchronous way. Internally, this method calls InvokeApiInternal
that contains the following:
var response = this.httpClient.SendAsync(httpRequest).GetAwaiter().GetResult();
With this, it should not be difficult to provide an async
overload of the method, which will not block the thread while the document is processed…