using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; namespace HPSocketCS { /// /// http版本号 /// public enum HttpVersion { /// /// http 1.0 /// V1_0 = 1, /// /// http 1.1 /// v1_1 = 257, } /// /// URL 域 /// HTTP 请求行中 URL 段位的域定义 /// public enum HttpUrlField { Schema = 0, Host = 1, Port = 2, Path = 3, QueryString = 4, Fragment = 5, UserInfo = 6, /// /// Field Count /// Max = 7, } /// /// HTTP 解析结果标识 /// 指示 HTTP 解析器是否继续执行解析操作 /// public enum HttpParseResult { /// /// 终止解析,断开连接 /// Error = -1, /// /// 继续解析 /// Ok = 0, /// /// 跳过当前请求 BODY(仅用于 OnHeadersComplete 事件) /// SkipBody = 1, /// /// 升级协议(仅用于 OnHeadersComplete 事件) /// Upgrade = 2, } public enum HttpStatusCode { Continue = 100, SwitchingProtocols = 101, Processing = 102, Ok = 200, Created = 201, Accepted = 202, NonAuthoritativeInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultiStatus = 207, MultipleChoices = 300, MovedPermanently = 301, MovedTemporarily = 302, SeeOther = 303, NotModified = 304, UseProxy = 305, SwitchProxy = 306, TemporaryRedirect = 307, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticationRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, LengthRequired = 411, PreconditionFailed = 412, RequestEntityTooLarge = 413, RequestUriTooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfiable = 416, ExpectationFailed = 417, UnprocessableEntity = 422, Locked = 423, FailedDependency = 424, UnorderedCollection = 435, UpgradeRequired = 426, RetryWith = 449, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HttpVersionNotSupported = 505, VariantAlsoNegotiates = 506, InsufficientStorage = 507, BandwidthLimitExceeded = 509, NotExtended = 510, UnparseableResponseHeaders = 600, } /// /// Name/Value 结构体 /// 字符串名值对结构体 /// public struct TNVPair { [MarshalAs(UnmanagedType.LPStr)] public string Name; [MarshalAs(UnmanagedType.LPStr)] public string Value; } public class HttpSdk { } }