问题
I have a .NET MVC application which is calling a WCF service. I need to include a JWT token in the HTTP header of the MVC application and decode the token in the WCF application. The binding is basicHttpBinding. I would appreciate any suggestions...
回答1:
assuming you are inside controller method write :
ControllerContext.HttpContext.Response.AddHeader("name","value")
回答2:
I finally managed to find a solution and I've sent the token through a SOAP header.
For that I just had to add
<headers>
<headerName>Value</headerName>
</headers>
来源:https://stackoverflow.com/questions/18780457/mvc-add-token-in-http-header