/// <summary> /// 返回授权结果 /// </summary> /// <param name="Queryparams">获取授权token参数</param> /// <returns></returns> public string GetAccessTokenByAuthorized(List <Parameter> Queryparams) { string ResultStr = null; try { AuthModel Auths = null; //ResultStr = http.HttpGet(APIType.GetURL(TypeOption.MD_OAUTH2_ACCESSTOKEN), HttpUtility.NormalizeRequestParameters(Queryparams)); ResultStr = http.HttpGet(APIType.GetURL(TypeOption.MD_OAUTH2_ACCESSTOKEN), HttpUtility.NormalizeRequestParameters(Queryparams)); Auths = XmlSerializationHelper.XmlToObject <AuthModel>(ResultStr); if (Auths != null) { if (!string.IsNullOrEmpty(Auths.Error_Code)) { return(Auths.Error_Code); } return(!string.IsNullOrEmpty(Auths.access_token) ? Auths.access_token : string.Empty); } else { return("Error:10101"); } } catch (Exception ex) { throw new Exception(ex.Message.ToString() + ";" + APIType.GetURL(TypeOption.MD_OAUTH2_ACCESSTOKEN)); } }
public bool AsyncRequest(TypeOption option, List <Parameter> ListParam, List <Parameter> ListFile, AsyncRequestCallback Callback, out int CallbKey) { return(base.AsyncRequest(APIType.GetURL(option), APIType.GetHttpMethod(option), OauthKey, ListParam, ListFile, Callback, out CallbKey)); }
public string SyncRequest(TypeOption option, List <Parameter> ListParam, List <Parameter> ListFile) { return(base.SyncRequest(APIType.GetURL(option), APIType.GetHttpMethod(option), OauthKey, ListParam, ListFile)); }