jenius-apps / nightingale-rest-api-client

A modern, resource-efficient REST API client for Windows
https://nightingale.rest
MIT License
769 stars 36 forks source link

An error occurred while sending the request. at System.Net.Http.HttpClientHandler.<SendAsync>d__113.MoveNext #169

Open kshyju opened 3 years ago

kshyju commented 3 years ago

I am getting an error when issuing a simple GET request. Here is the stack trace.

The same request works from ARC/Edge browser. FWIW, the endpoint returns 204 response.

image

An error occurred while sending the request. at System.Net.Http.HttpClientHandler.d113.MoveNext() + 0x361 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17 at System.Net.Http.HttpClient.d62.MoveNext() + 0x316 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17 at Nightingale.Core.Client.NightingaleClient.d7.MoveNext() + 0x26f --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17 at Nightingale.Core.Services.RequestSender.d5.MoveNext() + 0x156

dpaulino commented 3 years ago

What's the request URL?

kshyju commented 3 years ago

http://localhost:5000/api/somelocalendpoint

dpaulino commented 3 years ago

Have you tried this? https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md

igor-klymenok commented 3 years ago

I'm also getting same error. Here is my stack trace:

An error occurred while sending the request.
   at System.Net.Http.HttpClientHandler.<SendAsync>d__113.MoveNext() + 0x361
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__62.MoveNext() + 0x316
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Client.NightingaleClient.<SendAsync>d__7.MoveNext() + 0x26f
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Services.RequestSender.<SendRequestAsync>d__5.MoveNext() + 0x156

I found that this issue appearing for me, when I'm trying to make a request to disabled (not working) server.
After I start the server, I'm seeing an infinite spinner and then error above. Only application restart helps.

P.S. For sure I did required steps in https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md