Amazon web services .NET核心生成意外的内容类型
我和我的团队创建了.net核心web应用程序,它托管在AWS elastic beanstalk上,通常所有api端点都返回application/json,这是通过指定Amazon web services .NET核心生成意外的内容类型,amazon-web-services,asp.net-core,https,amazon-elastic-beanstalk,Amazon Web Services,Asp.net Core,Https,Amazon Elastic Beanstalk,我和我的团队创建了.net核心web应用程序,它托管在AWS elastic beanstalk上,通常所有api端点都返回application/json,这是通过指定 .AddMvc(options => ... options.Filters.Add(new ProducesAttribute(MimeTypeConstants.ApplicationJson))); 但我们需要在一个特定操作中返回一个内容类型为“text/plain”的字符串。我已尝试将该属性添加到此特定操作[
.AddMvc(options =>
...
options.Filters.Add(new ProducesAttribute(MimeTypeConstants.ApplicationJson)));
但我们需要在一个特定操作中返回一个内容类型为“text/plain”的字符串。我已尝试将该属性添加到此特定操作[products(“text/plain”)]
使用VS和测试端点在本地运行效果很好(返回内容类型为“text/plain”的字符串),但部署的应用程序仍然返回内容类型“application/json”
还有什么需要配置的吗