| | |
| | | /// <summary> |
| | | /// 请求超时时间 |
| | | /// </summary> |
| | | public const int TIME_OUT = 10; |
| | | public const int TIME_OUT = 15; |
| | | /// <summary> |
| | | /// 特殊接口请求超时时间 |
| | | /// </summary> |
| | |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsGet(string apiPath, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) |
| | | public static ResponsePackNew RequestHttpsGet(string apiPath, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | return RequestHttps(Method.GET, apiPath, null, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); |
| | | } |
| | |
| | | ///// <param name="mTimeout">请求超时时间,默认10</param> |
| | | ///// <param name="urlHead"></param> |
| | | ///// <returns></returns> |
| | | //public static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10, bool needErrorTip = true) |
| | | //public static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT, bool needErrorTip = true) |
| | | //{ |
| | | // var mResponsePackNew = RequestHttps(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); |
| | | // if (needErrorTip) |
| | |
| | | /// <param name="bodyParameterJson"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = 10) |
| | | public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = TIME_OUT) |
| | | { |
| | | string urlHead = DB_ResidenceData.Instance.CurrentRegion.regionUrl; |
| | | //var replaceToken = ""; |
| | |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsPost(string apiPath, string bodyParameterJson, string urlHead = "", string replaceToken = "", int mTimeout = 10) |
| | | public static ResponsePackNew RequestHttpsPost(string apiPath, string bodyParameterJson, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, replaceToken, mTimeout); |
| | | } |
| | |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsPost(string apiPath, Dictionary<string, object> queryDictionary, string urlHead = "", string replaceToken = "", int mTimeout = 10) |
| | | public static ResponsePackNew RequestHttpsPost(string apiPath, Dictionary<string, object> queryDictionary, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | return RequestHttps(Method.POST, apiPath, null, queryDictionary, null, urlHead, replaceToken, mTimeout); |
| | | } |
| | |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) |
| | | static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | //Dome模式登录 |
| | | |
| | |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) |
| | | public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | var responsePackNew = RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); |
| | | //*****************Token过期处理***************** |
| | |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsUpload(Method method, string apiPath, object bodyParameterObject = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = 10) |
| | | public static ResponsePackNew RequestHttpsUpload(Method method, string apiPath, object bodyParameterObject = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | #region HttpWebRequest |
| | | try |