public string BuildUrlToRequestHashForPath(string path, IDownloadMediaOptions options) { string originalUrl = this.BuildUrlStringForPath(path, options); string encodedOriginalUrl = UrlBuilderUtils.EscapeDataString(originalUrl); var actionBuilder = new WebApiActionBuilder(this.restGrammar, this.webApiGrammar); string result = actionBuilder.GetHashedMediaUrlAction(this.sessionConfig); result = result + this.restGrammar.HostAndArgsSeparator + this.webApiGrammar.UrlForHashingParameterName + this.restGrammar.KeyValuePairSeparator + encodedOriginalUrl; return(result); }
public string GetUrlForRequest(IGetRenderingHtmlRequest request) { this.ValidateSpecificRequest(request); var actionBuilder = new WebApiActionBuilder(this.restGrammar, this.webApiGrammar); string hostUrl = actionBuilder.GetRenderingHtmlAction(request.SessionSettings); string baseParameters = this.GetCommonPartForRequest(request).ToLowerInvariant(); string specificParameters = this.GetSpecificPartForRequest(request); string allParameters = baseParameters; if (!string.IsNullOrEmpty(specificParameters)) { allParameters = allParameters + this.restGrammar.FieldSeparator + specificParameters; } bool shouldTruncateBaseUrl = (!string.IsNullOrEmpty(allParameters) && allParameters.StartsWith(this.restGrammar.FieldSeparator)); while (shouldTruncateBaseUrl) { allParameters = allParameters.Substring(1); shouldTruncateBaseUrl = (!string.IsNullOrEmpty(allParameters) && allParameters.StartsWith(this.restGrammar.FieldSeparator)); } string result = hostUrl; if (!string.IsNullOrEmpty(allParameters)) { result = result + this.restGrammar.HostAndArgsSeparator + allParameters; } return(result); }
public string GetUrlForRequest(IGetRenderingHtmlRequest request) { this.ValidateSpecificRequest(request); var actionBuilder = new WebApiActionBuilder(this.restGrammar, this.webApiGrammar); string hostUrl = actionBuilder.GetRenderingHtmlAction(request.SessionSettings); string baseParameters = this.GetCommonPartForRequest(request).ToLowerInvariant(); string specificParameters = this.GetSpecificPartForRequest(request); string allParameters = baseParameters; if (!string.IsNullOrEmpty(specificParameters)) { allParameters = allParameters + this.restGrammar.FieldSeparator + specificParameters; } bool shouldTruncateBaseUrl = (!string.IsNullOrEmpty(allParameters) && allParameters.StartsWith(this.restGrammar.FieldSeparator)); while (shouldTruncateBaseUrl) { allParameters = allParameters.Substring(1); shouldTruncateBaseUrl = (!string.IsNullOrEmpty(allParameters) && allParameters.StartsWith(this.restGrammar.FieldSeparator)); } string result = hostUrl; if (!string.IsNullOrEmpty(allParameters)) { result = result + this.restGrammar.HostAndArgsSeparator + allParameters; } return result; }
private string PrepareRequestUrl(ISessionConfig request) { WebApiActionBuilder builder = new WebApiActionBuilder(this.restGrammar, this.webApiGrammar); return(builder.GetAuthenticateActionUrlForSession(request)); }
public string BuildUrlToRequestHashForPath(string path, IDownloadMediaOptions options) { string originalUrl = this.BuildUrlStringForPath(path, options); string encodedOriginalUrl = UrlBuilderUtils.EscapeDataString(originalUrl); var actionBuilder = new WebApiActionBuilder(this.restGrammar, this.webApiGrammar); string result = actionBuilder.GetHashedMediaUrlAction(this.sessionConfig); result = result + this.restGrammar.HostAndArgsSeparator + this.webApiGrammar.UrlForHashingParameterName + this.restGrammar.KeyValuePairSeparator + encodedOriginalUrl; return result; }