HttpClient - task was cancelled - How to get the exact error message?

前端 未结 4 1973
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 01:44

I have the following test code. I always get the \"Task was cancelled\" error after looping 316934 or 361992 times.

If I am not wrong, there are two possible reasons why

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 02:34

    I ran across this recently. As it turned out, when I started up the web application in debug mode, the start up URL was using https.

    However, the URL for WebApi endpoint (in my config file) was using http. Once I update it to use https, I was able to call the WebApi endpoint.

提交回复
热议问题