Пример #1
0
        /// <summary>
        /// 获取某个请求头(多值)
        /// </summary>
        /// <param name="connId"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public List <string> GetHeaders(IntPtr connId, string key)
        {
            var list = new List <string>();

            try
            {
                IntPtr[] arr   = null;
                uint     count = 0;
                HttpSdk.HP_HttpAgent_GetHeaders(pAgent, connId, key, arr, ref count);
                if (count > 0)
                {
                    arr = new IntPtr[count];
                    if (HttpSdk.HP_HttpAgent_GetHeaders(pAgent, connId, key, arr, ref count) && count > 0)
                    {
                        foreach (var item in arr)
                        {
                            list.Add(Common.PtrToAnsiString(item));
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
            return(list);
        }