#region Copyright (C) 2016 Kevin (OSS开源系列) 公众号:osscoder /*************************************************************************** *   文件功能描述:Http请求 == 请求实体 * *   创建人: Kevin * 创建人Email:1985088337@qq.com * *****************************************************************************/ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; namespace OSS.Http.Mos { /// /// 请求实体 /// public class OsHttpRequest { public OsHttpRequest() { FormParameters = new List(); FileParameters = new List(); } /// /// 请求地址信息 /// public Uri Uri{ get; set; } /// /// 如果此值设置,则忽略 Uri 值 /// 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; } /// /// reqMessage 设置方法 /// 如果当前的设置不能满足需求,可以通过这里再次设置 /// public Action RequestSet { get; set; } #region 请求的内容参数 /// /// 文件参数列表 /// public List FileParameters { get; set; } /// /// 是否存在文件 /// public bool HasFile => FileParameters.Any(); /// /// 非文件参数列表 /// public List FormParameters { get; set; } #endregion /// /// 自定义内容实体 /// eg:当上传文件时,无法自定义内容 /// public string CustomBody { get; set; } /// /// 超时时间(毫秒) /// public int TimeOutMilSeconds { get; set; } } }