System.Net.WebHeaderCollection.ToByteArray C# (CSharp) Метод

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

public ToByteArray ( ) : byte[]
Результат byte[]
        public byte[] ToByteArray() { throw null; }
        public static bool IsRestricted(string headerName, bool response) { throw null; }

Usage Example

Пример #1
0
        private void PreparePackets(long length)
        {
            //string postData = "?" + string.Join("&", arguments.Select(x => x.Key + "=" + x.Value).ToArray());
            postMethod = Encoding.Default.GetBytes(string.Format("POST {0} HTTP/1.1\r\n", url.AbsolutePath));

            WebHeaderCollection headers = new WebHeaderCollection();
            headers.Add(HttpRequestHeader.ContentType, "multipart/form-data; boundary=" + boundary);
            headers.Add(HttpRequestHeader.Host, url.DnsSafeHost);
            headers.Add(HttpRequestHeader.ContentLength, (request.Length + length + requestEnd.Length).ToString());
            headers.Add(HttpRequestHeader.Connection, "Keep-Alive");
            headers.Add(HttpRequestHeader.CacheControl, "no-cache");

            headerBytes = headers.ToByteArray();
        }
All Usage Examples Of System.Net.WebHeaderCollection::ToByteArray