diff --git a/src/Refit/RequestBuilderImplementation.cs b/src/Refit/RequestBuilderImplementation.cs index 168ec9167..d056dfa24 100644 --- a/src/Refit/RequestBuilderImplementation.cs +++ b/src/Refit/RequestBuilderImplementation.cs @@ -626,12 +626,13 @@ object itemValue "BaseAddress must be set on the HttpClient instance" ); - var factory = BuildRequestFactoryForMethod( + var rq = await BuildRequestMessageForMethodAsync( restMethod, client.BaseAddress.AbsolutePath, - restMethod.CancellationToken != null - ); - var rq = factory(paramList); + restMethod.CancellationToken != null, + paramList + ).ConfigureAwait(false); + HttpResponseMessage? resp = null; HttpContent? content = null; var disposeResponse = true; @@ -982,24 +983,6 @@ static bool ShouldIgnorePropertyInQueryMap(PropertyInfo propertyInfo) return false; } - - Func BuildRequestFactoryForMethod( - RestMethodInfoInternal restMethod, - string basePath, - bool paramsContainsCancellationToken - ) - { - return paramList => - RunSynchronous(() => - BuildRequestMessageForMethodAsync( - restMethod, - basePath, - paramsContainsCancellationToken, - paramList - ) - ); - } - async Task BuildRequestMessageForMethodAsync( RestMethodInfoInternal restMethod, string basePath,