using Apewer;
using Apewer.Network;
using System;
using System.Net;
namespace Apewer.Web
{
///
[Serializable]
public sealed class ApiRequest
{
private Json _data = null;
internal string[] _segmentals = null;
/// 自定义标签。
public object Tag { get; set; }
#region http
/// 客户端 IP 地址。
public string IP { get; set; }
///
public Uri Url { get; set; }
///
public string Referrer { get; set; }
/// HTTP 头中的 User Agent 字符串。
public string UserAgent { get; set; }
/// HTTP 方法。
public HttpMethod Method { get; set; }
/// 已解码的 URL 参数。
public StringPairs Parameters { get; set; } = new StringPairs();
/// HTTP 头。
public HttpHeaders Headers { get; set; } = new HttpHeaders();
/// Cookies。
public CookieCollection Cookies { get; set; } = new CookieCollection();
#endregion
#region api
///
public string Application { get; set; }
///
public string Function { get; set; }
///
public string Random { get; set; }
///
public string Ticket { get; set; }
///
public string Session { get; set; }
///
public string Page { get; set; }
#endregion
#region post
///
public byte[] PostData { get; set; }
///
public string PostText { get; set; }
///
public Json PostJson { get; set; }
/// 已解码的 POST 参数,仅当内容类型为 application/x-www-form-urlencoded 时有效。
public StringPairs Form { get; set; }
///
public Json Data
{
get
{
if (_data == null) _data = Json.NewObject();
return _data;
}
set { _data = value; }
}
#endregion
}
}