gpt4 book ai didi

asp.net - Azure Web应用程序,自定义状态代码描述不起作用

转载 作者:可可西里 更新时间:2023-11-01 16:35:35 25 4
gpt4 key购买 nike

我将 ASP.NET 部署到 Azure Web 应用程序。此 Web 应用程序具有端点/usageinfo 和自定义状态代码描述以下是本地主机中的结果: Localhost result

但是,网络应用程序显示不同的结果: Web app result

代码

  return new HttpStatusCodeResult(usageInfo >= 95 ? 503 : 200,
$"Account {BomEnvironment.EmbedUsername}. UsageInfo={usageInfo}");

为什么它们不同?

谢谢

最佳答案

我使用以下代码在我的网站中进行测试,它在本地和 Azure 上都可以工作。

public HttpStatusCodeResult HelloWorld()
{
var aa = "joey";
return new HttpStatusCodeResult(HttpStatusCode.Accepted, $"Account {aa}.");
}

enter image description here

关于asp.net - Azure Web应用程序,自定义状态代码描述不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57212652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com