diff options
author | Serghei Cebotari <serghei@cebotari.ru> | 2023-11-02 23:31:17 +0300 |
---|---|---|
committer | Serghei Cebotari <serghei@cebotari.ru> | 2023-11-02 23:31:17 +0300 |
commit | 6d6e91867ce67f2c4e3f3db47a14173fa3bb598d (patch) | |
tree | 5570ad181857c8c62f6e82757b17226939c2bd9c | |
parent | 4bc663c2ab9c800b72b5ccb38f3e82977df1b317 (diff) |
Use UriBuilder to create request uri
-rw-r--r-- | RhSolutions.AddIn/Services/DatabaseClient.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/RhSolutions.AddIn/Services/DatabaseClient.cs b/RhSolutions.AddIn/Services/DatabaseClient.cs index ac4dfa5..69f7fc1 100644 --- a/RhSolutions.AddIn/Services/DatabaseClient.cs +++ b/RhSolutions.AddIn/Services/DatabaseClient.cs @@ -54,7 +54,11 @@ public class DatabaseClient : IDatabaseClient else { - string request = @"https://rh.cebotari.ru/api/search?query=" + line; + UriBuilder builder = new(@"https://rh.cebotari.ru/api/search") + { + Query = $"query={line.Replace("&", "%26")}" + }; + string request = builder.Uri.AbsoluteUri; if (!_memoryCache.TryGetValue(line, out IEnumerable<Product> products)) { |