using Apewer; using Apewer.Internals; using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Text; namespace Apewer.Network { /// public class HttpResponse { // ======================================== internal TextSet _properties = new TextSet(true); internal TextSet _headers = new TextSet(true); internal Action _progress = null; internal Stream _stream = null; internal byte[] _data = Constant.EmptyBytes; internal long _contentlength = 0L; internal bool _locked = false; internal int _timeout = 0; // ---------------------------------------- internal bool _cached = false; internal CookieCollection _cookies = null; internal HttpStatusCode _statuscode = 0; // ======================================== /// public TextSet Headers { get { return _headers; } } /// public byte[] Data { get { return _data; } } /// public Stream Stream { get { return _stream; } set { _stream = value; } } /// public Action ProgressCallback { get { return _progress; } set { _progress = value; } } /// public string Encoding { get { return _headers["Encoding"]; } set { _headers["Encoding"] = value; } } /// public string ContentType { get { return _headers["ContentType"]; } } /// public int Timeout { get { return _timeout; } set { _timeout = value < 0 ? 0 : value; } } /// public long ContentLength { get { return _contentlength; } } /// public string Url { get { return _properties["Url"]; } } // ---------------------------------------- /// public HttpStatusCode StatusCode { get { return _statuscode; } } /// public CookieCollection Cookies { get { return _cookies; } } /// public bool Cached { get { return _cached; } } /// public string CharacterSet { get { return _properties["CharacterSet"]; } } /// public string ContentEncoding { get { return _properties["ContentEncoding"]; } } /// public string Method { get { return _properties["Method"]; } } /// public string ProtocolVersion { get { return _properties["ProtocolVersion"]; } } /// public string Server { get { return _properties["Server"]; } } /// public string StatusDescription { get { return _properties["StatusDescription"]; } } // ======================================== } }