Fixed endpoint URLs

This commit is contained in:
2023-12-13 23:47:39 +01:00
parent 39bac2a845
commit 2e5e2fc20b
3 changed files with 15 additions and 14 deletions

View File

@@ -101,7 +101,7 @@ namespace WD7UVN_HFT_2023241.Client
public static T Get<T>(int id, string endpoint)
{
T item = default(T);
HttpResponseMessage response = client.GetAsync(endpoint + "/" + id.ToString()).GetAwaiter().GetResult();
HttpResponseMessage response = client.GetAsync(endpoint + id.ToString()).GetAwaiter().GetResult();
if (response.IsSuccessStatusCode)
{
item = response.Content.ReadAsAsync<T>().GetAwaiter().GetResult();
@@ -130,7 +130,7 @@ namespace WD7UVN_HFT_2023241.Client
public static void Delete(int id, string endpoint)
{
HttpResponseMessage response =
client.DeleteAsync(endpoint + "/" + id.ToString()).GetAwaiter().GetResult();
client.DeleteAsync(endpoint + id.ToString()).GetAwaiter().GetResult();
if (!response.IsSuccessStatusCode)
{