可以删除HttpResponseMessage标头吗?

时间:2018-05-20 08:23:51

标签: azure-functions

我的Azure函数返回一个HttpResponseMessage。可以删除 响应的标题?以下似乎没有做到这一点。

[FunctionName("HealthProbe")]
    public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log)
    {
        HttpResponseMessage response = new HttpResponseMessage
        {
            StatusCode = HttpStatusCode.OK,
            Content = new StringContent(DateTime.Now.ToShortTimeString()) 
        };
        response.Headers.Clear();
        response.Content.Headers.Clear();
        return response;
    }

0 个答案:

没有答案