Reputation: 245
Does anyone know how to read all http headers from classic asp request object in c# into a string? My code is this:
ASPTypeLibrary.IRequestDictionary dictionary = request.ServerVariables;
object headers = dictionary["ALL_HTTP"];
return (string)headers;
The last line fails.
Please help! GRR COM!
Upvotes: 1
Views: 701
Reputation: 245
I managed to get the value out by doing the following:
string variableValue = string.Empty;
foreach (string item in ((IEnumerable)request["ALL_HTTP"])) variableValue = item;
Upvotes: 2