123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- namespace HPSocketCS
- {
- /// <summary>
- /// http版本号
- /// </summary>
- public enum HttpVersion
- {
- /// <summary>
- /// http 1.0
- /// </summary>
- V1_0 = 1,
- /// <summary>
- /// http 1.1
- /// </summary>
- v1_1 = 257,
- }
- /// <summary>
- /// URL 域
- /// HTTP 请求行中 URL 段位的域定义
- /// </summary>
- public enum HttpUrlField
- {
- Schema = 0,
- Host = 1,
- Port = 2,
- Path = 3,
- QueryString = 4,
- Fragment = 5,
- UserInfo = 6,
- /// <summary>
- /// Field Count
- /// </summary>
- Max = 7,
- }
- /// <summary>
- /// HTTP 解析结果标识
- /// 指示 HTTP 解析器是否继续执行解析操作
- /// </summary>
- public enum HttpParseResult
- {
- /// <summary>
- /// 终止解析,断开连接
- /// </summary>
- Error = -1,
- /// <summary>
- /// 继续解析
- /// </summary>
- Ok = 0,
- /// <summary>
- /// 跳过当前请求 BODY(仅用于 OnHeadersComplete 事件)
- /// </summary>
- SkipBody = 1,
- /// <summary>
- /// 升级协议(仅用于 OnHeadersComplete 事件)
- /// </summary>
- 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,
- }
- /// <summary>
- /// Name/Value 结构体
- /// 字符串名值对结构体
- /// </summary>
- public struct TNVPair
- {
- [MarshalAs(UnmanagedType.LPStr)]
- public string Name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string Value;
- }
- public class HttpSdk
- {
- }
- }
|