Click here to Skip to main content
16,021,041 members

Comments by koenigseggccxr (Top 1 by date)

koenigseggccxr 3-Oct-12 5:56am View    
I have a requirement similar to the original poster which I am really struggling with so any help would be really appreciated. I have to pass a token (string) in a HTTP request header to a 3rd party web application. In order to set up a test environment I create 2 ASP.Net websites, 1 which is my website which will set the HTTP request header value and the other which is simulating the 3rd party web application which will receive the HTTP request header. I have successfully set the request header on my website and verified this using the code below. I then perform a Response.Redirect to the simulated 3rd party web application which also uses the code below to determine if the token request header was received. Unfortunately the token request header is never displayed on the simulated 3rd party web application. I believe that I am setting the request header correctly so I feel that the problem is either with the way that I am attempting to transfer it to the simulated 3rd party web application or perhaps the request header is being sent to the simulated 3rd party web application but the way that I am checking for it is incorrect. I will be really grateful for any help or advice on this challenge. Here is the code I referred to earlier: headers = Request.Headers; for (int i = 0; i < headers.Count; i++) { string key = headers.GetKey(i); string value = headers.Get(i); Response.Write(key + " = " + value + " "); }