/// <summary> /// To be called by a deriving class when the request is to be executed /// </summary> /// <param name="baseUrlType">Identifies the base URL which is to be used for the request</param> /// <param name="suffixFormat">Suffix format string to be tacked onto the end of a request URL</param> /// <param name="args">Arguments for the format string</param> protected void SendRequest( BaseHttpReqUrlType baseUrlType, string suffixFormat, params object[] args ) { string url = BuildApiPath( baseUrlType, suffixFormat, args ); base.SendRequest( url, SourceSettings.Credentials ); }
private string BuildApiPath( BaseHttpReqUrlType baseUrlType, string suffixFormat, params object[] args ) { if( baseUrlType == BaseHttpReqUrlType.Repo ) { return string.Format( "{0}/repos/{1}/{2}{3}", SourceSettings.ApiServerUrl, SourceSettings.UserName, SourceSettings.RepoName, string.Format( suffixFormat, args ) ); } else if( baseUrlType == BaseHttpReqUrlType.None ) { return SourceSettings.ApiServerUrl + string.Format( suffixFormat, args ); } else { return string.Format( suffixFormat, args ); } }