using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; namespace OSS.Http.Models { /// /// /// public class OsHttpRequest { public OsHttpRequest() { Parameters = new List(); FileParameterList = new List(); } /// /// 请求地址信息 /// public string AddressUrl { get; set; } /// /// 请求方式 /// public HttpMothed HttpMothed { get; set; } ///// ///// 是否允许自动重定向 ///// 默认为true 最大可重定向次数为 5 ///// //public bool AllowAutoRedirect { get; set; } = true; ///// ///// 是否使用压缩 ///// //public bool AutoDecompres { get; set; } ///// ///// 是否使用cookie ///// //public bool UseCookies { get; set; } /// /// 头部属性自定义设置 /// public Action HeaderSetting { get; set; } /// /// HttpClientHandler 自定义属性设置 /// public Action HandlerSetting { get; set; } #region 请求的内容参数 /// /// 文件参数列表 /// public List FileParameterList { get; set; } /// /// 是否存在文件 /// public bool HasFile { get { return FileParameterList.Any(); } } /// /// 非文件参数列表 /// public List Parameters { get; set; } #endregion /// /// 自定义内容实体 /// eg:当上传文件时,无法自定义内容 /// public string CustomBody { get; set; } /// /// 超时时间(毫秒) /// public int TimeOutMilSeconds { get; set; } } }