Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services .NET核心生成意外的内容类型_Amazon Web Services_Asp.net Core_Https_Amazon Elastic Beanstalk - Fatal编程技术网

Amazon web services .NET核心生成意外的内容类型

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”的字符串。我已尝试将该属性添加到此特定操作[

我和我的团队创建了.net核心web应用程序,它托管在AWS elastic beanstalk上,通常所有api端点都返回application/json,这是通过指定

.AddMvc(options => 
...
options.Filters.Add(new ProducesAttribute(MimeTypeConstants.ApplicationJson)));
但我们需要在一个特定操作中返回一个内容类型为“text/plain”的字符串。我已尝试将该属性添加到此特定操作
[products(“text/plain”)]

使用VS和测试端点在本地运行效果很好(返回内容类型为“text/plain”的字符串
),但部署的应用程序仍然返回内容类型
“application/json”
还有什么需要配置的吗