This commit is contained in:
2025-07-17 09:27:47 +03:30
parent 6178c9d4e6
commit b26e486147
2 changed files with 31 additions and 13 deletions
+24 -5
View File
@@ -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);