0

I have two ASP.NET solutions. Bot are running under different IIS websites. Lets say first one is called SOLUTION-A (this is a intranet portal) and the other one is SOLUTION-B (custom business process solution).

I want to add custom header to SOLUTION-A before i call SOLUTION-B via simple html link like

X-PERMS_GUID

X-CALLER_GUID

Then in SOLUTION-B i want to read those two custom header from the request.

How can i do this?

STORM
  • 4,005
  • 11
  • 49
  • 98
  • 2
    Possible duplicate of [Adding custom HTTP headers using JavaScript](https://stackoverflow.com/questions/581383/adding-custom-http-headers-using-javascript) – Bob Swager Jul 10 '17 at 10:29

1 Answers1

0

In c# you can add custom header like so:

var client = new HttpClient()
client.DefaultRequestHeaders.Add("X-PERMS_GUID","1");

Read custom header:

IEnumerable<string> headerValues = request.Headers.GetValues("X-PERMS_GUID");
var id = headerValues.FirstOrDefault();
Jordi Flores
  • 2,080
  • 10
  • 16