简体   繁体   English

如何在自定义身份验证标头中使用HTTP响应

[英]How to use HTTP response with custom authentication header

What I am trying to do is send http response to browser with my custom http header. 我想做的就是使用自定义的HTTP标头将HTTP响应发送到浏览器。 I expect browser to pass that custom http head back to web server every time it make request. 我希望浏览器每次发出请求时,都会将该自定义http头传递回Web服务器。 But it does not. 但事实并非如此。

I am using C# ASP.net MVC. 我正在使用C#ASP.net MVC。 When I return my custom ActionResult. 当我返回自定义ActionResult时。

public override void ExecuteResult(ControllerContext context)
{
            base.ExecuteResult(context);
            context.HttpContext.Response.AppendHeader("AuthenticationInfo", "1234567890");
}

我需要做的是将响应HTTP标头作为cookie。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何基于HTTP头创建自定义身份验证机制? - How to create custom authentication mechanism based on HTTP header? WCF 主机向响应添加自定义 HTTP 标头 - WCF host to add custom HTTP header to response WCF hosted as Windows service - Custom HTTP header is not reflecting on Response header - WCF hosted as Windows service - Custom HTTP header is not reflecting on Response header 如何删除特定页面的http响应标头? - How to remove http response header for specific pages? 通过 C# 访问自定义 HTTP 响应 Header - Accessing custom HTTP Response Header via C# 在Squid代理身份验证期间无法获取代理授权标头作为HTTP响应 - Unable to get Proxy-Authorization Header as HTTP response during Squid proxy Authentication 自定义响应标头未发送 - Custom response header not sent 当自定义基本身份验证提供程序的身份验证失败时,返回自定义 HTTP 响应代码 - Returning a custom HTTP response code when the authentication fails for a custom basic auth provider 当自定义凭据身份验证提供程序的身份验证失败时,返回自定义 HTTP 响应代码 - Returning a custom HTTP response code when the authentication fails for a custom credentials auth provider 如何使用.NET HttpWebRequest API从响应中读取HTTP头? - How to read HTTP header from response using .NET HttpWebRequest API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM