当我尝试使用 https 对工作 http 的同一个 WebAPI 控制器调用执行 GET、PUT、POST、DELETE 时,我遇到了错误(奇怪的错误)。带有 WebAPI 控制器的 https 是否需要任何特殊的 web.config 魔法?
** 添加错误:
(这是当我点击与使用 http 相同的 GET web api 控制器时得到的错误代码。也就是说,http 有效,https 失败并出现此错误)
{"message":"An error has occurred.","exceptionMessage":"A null value was returned where an instance of HttpResponseMessage was expected.","exceptionType":"System.InvalidOperationException","stackTrace":" at System.Web.Http.Controllers.ResponseMessageResultConverter.Convert(HttpControllerContext controllerContext, Object actionResult)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<>c__DisplayClass3.<InvokeActionAsync>b__1(Object value)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass3b`2.<Then>b__3a(Task`1 t)\r\n at System.Threading.Tasks.TaskHelpersExtensions.ThenImpl[TTask,TOuterResult](TTask task, Func`2 continuation, CancellationToken cancellationToken, Boolean runSynchronously)"}