Blighttp.Request.Request C# (CSharp) Метод

Request() публичный Метод

public Request ( string clientAddress, RequestType type, string path, double version, string>.Dictionary headers, bool useRealIP ) : System
clientAddress string
type RequestType
path string
version double
headers string>.Dictionary
useRealIP bool
Результат System
        public Request(string clientAddress, RequestType type, string path, double version, Dictionary<string, string> headers, bool useRealIP)
        {
            Type = type;
            Path = path;
            Version = version;
            Headers = headers;
            string lengthString;
            if (Headers.TryGetValue("Content-Length", out lengthString))
            {
                try
                {
                    ContentLength = Convert.ToInt32(lengthString);
                }
                catch (FormatException)
                {
                    throw new ClientException("Invalid content length specified");
                }
            }
            else
                ContentLength = null;

            if (useRealIP)
            {
                if (!Headers.TryGetValue("X-Real-IP", out ClientAddress))
                    ClientAddress = clientAddress;
            }
            else
                ClientAddress = clientAddress;

            Content = new Dictionary<string, string>();

            //Arguments are null until set by a non-default Handler
            Arguments = null;

            RequestHandler = null;
        }