/// <summary>
        ///     Получить содержимое
        /// </summary>
        /// <param name="hRequest">
        ///     Указатель на HTTPS-запрос
        /// </param>
        /// <param name="result">
        ///     Результат HTTPS-запроса
        /// </param>
        private static void GetContent(IntPtr hRequest, HttpResult result)
        {
            using (var stream = new MemoryStream())
            {
                const uint chunkSize = 1024U;
                using (var buffer = InteropUtil.Alloc(chunkSize))
                {
                    while (true)
                    {
                        var bytesRead = 0U;
                        if (!WinInet.InternetReadFile(hRequest, buffer.Address, chunkSize, ref bytesRead))
                        {
                            ThrowWinInetLastException("InternetReadFile");
                        }

                        for (var i = 0; i < bytesRead; i++)
                        {
                            stream.WriteByte(Marshal.ReadByte(buffer.Address + i));
                        }

                        if (bytesRead <= 0)
                        {
                            break;
                        }
                    }
                }

                result.Content = stream.ToArray();
            }
        }
        /// <summary>
        ///     Получить тип содержимого
        /// </summary>
        /// <param name="hRequest">
        ///     Указатель на HTTPS-запрос
        /// </param>
        /// <param name="result">
        ///     Результат HTTPS-запроса
        /// </param>
        private static void GetContentType(IntPtr hRequest, HttpResult result)
        {
            var statusSize = 256U;

            using (var buffer = InteropUtil.Alloc(statusSize))
            {
                if (!WinInet.HttpQueryInfoW(
                        hRequest,
                        WinInet.HTTP_QUERY_CONTENT_TYPE,
                        buffer.Address,
                        ref statusSize,
                        IntPtr.Zero))
                {
                    ThrowWinInetLastException("HttpQueryInfoW(HTTP_QUERY_CONTENT_TYPE)");
                }

                result.ContentType = Marshal.PtrToStringUni(buffer.Address);
            }
        }
        /// <summary>
        ///     Получить код статуса HTTP
        /// </summary>
        /// <param name="hRequest">
        ///     Указатель на HTTPS-запрос
        /// </param>
        /// <param name="result">
        ///     Результат HTTPS-запроса
        /// </param>
        private static void GetStatusCode(IntPtr hRequest, HttpResult result)
        {
            uint statusSize = sizeof(uint);

            using (var buffer = InteropUtil.Alloc(statusSize))
            {
                if (!WinInet.HttpQueryInfoW(
                        hRequest,
                        WinInet.HTTP_QUERY_FLAG_NUMBER | WinInet.HTTP_QUERY_STATUS_CODE,
                        buffer.Address,
                        ref statusSize,
                        IntPtr.Zero))
                {
                    ThrowWinInetLastException("HttpQueryInfoW(HTTP_QUERY_FLAG_NUMBER|HTTP_QUERY_STATUS_CODE)");
                }

                result.Code = (HttpStatusCode)Marshal.ReadInt32(buffer.Address);
            }
        }