Last ...
This commit is contained in:
@@ -154,14 +154,12 @@ namespace xIdentityService.Providers {
|
||||
/// <summary>
|
||||
/// Get an Instance of RestRequest
|
||||
/// </summary>
|
||||
/// <param name="endpoint"></param>
|
||||
/// <param name="params"></param>
|
||||
/// <returns></returns>
|
||||
public RestRequest GetRestRequet (
|
||||
XApiAccountEndpoint endpoint,
|
||||
IDictionary<string, string> @params = null,
|
||||
bool addXPoweredValue = true,
|
||||
IDictionary<string, string> headers = null
|
||||
IDictionary<string, string> @params = null,
|
||||
IDictionary<string, string> headers = null,
|
||||
IDictionary<string, string> queryStrings = null
|
||||
) {
|
||||
//
|
||||
var url = endpoint.GetStringValue ();
|
||||
@@ -180,6 +178,27 @@ namespace xIdentityService.Providers {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Add Query Strings ...
|
||||
if (!queryStrings.IsNull () && queryStrings.Count > 0) {
|
||||
//
|
||||
url = $"{url}?";
|
||||
var enumerator = queryStrings.GetEnumerator ();
|
||||
while (enumerator.MoveNext ()) {
|
||||
//
|
||||
var item = enumerator.Current;
|
||||
|
||||
//
|
||||
url += $"{item.Key}={item.Value.ToUrlEncoded ()}&";
|
||||
}
|
||||
|
||||
//
|
||||
// remove lates & ...
|
||||
if (url.EndsWith ("&")) {
|
||||
url = url.Substring (0, url.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Create request ...
|
||||
var request = new RestRequest (url, DataFormat.Json);
|
||||
|
||||
Reference in New Issue
Block a user