MvcIntegrationTestFramework.Browsing.SimulatedWorkerRequest.GetKnownRequestHeader C# (CSharp) Method

GetKnownRequestHeader() public method

public GetKnownRequestHeader ( int index ) : string
index int
return string
        public override string GetKnownRequestHeader(int index)
        {
            // Override "Content-Type" header for POST requests, otherwise ASP.NET won't read the Form collection
            if (index == 12)
                if (string.Equals(_httpVerbName, "post", StringComparison.OrdinalIgnoreCase))
                    return "application/x-www-form-urlencoded";

            switch (index)
            {
                case 0x19:
                    return MakeCookieHeader();
                default:
                    if (_headers == null)
                        return null;
                    return _headers[GetKnownRequestHeaderName(index)];
            }
        }