refit icon indicating copy to clipboard operation
refit copied to clipboard

[BUG] Issue with Task<IApiResponse> on following request.

Open msmolka opened this issue 3 years ago • 1 comments

Describe the bug When calling method without return (with return works fine), The following call on the same HttpClient fails by void. No request is made.

e.g:

IApiResponse respone = await service.Update();

Definition IEndpoint

[Get("/")]
Task<IApiRespose<string>> Get()

[Put("/")]
Task<IApiRespose> Update()

Setup

this.httpClient = RestService.CreateHttpClient(options.ApiBaseUrl);
this.endpoint = RestService.For<IEndpoint>(this.httpClient)

await endpoint.Update() // works
await endpoint.Get()// no request is made

Side note. If I add HttpLoggingHandler to http client all works properly. If I change update to return IApiReponse<string> all works properly as well.

Environment

  • OS: Windows 10
  • Device: Rider
  • Version: 6.3.2
  • .NET: .NET Framework 4.6.2

msmolka avatar Jul 14 '22 14:07 msmolka

As a side note: If I read headers, it also works. So only case is where nothing else after response is read.

msmolka avatar Aug 01 '22 11:08 msmolka