This commit is contained in:
2024-10-13 16:34:46 +02:00
parent b6755ae77f
commit d7d7db8dd4
12 changed files with 140 additions and 85 deletions

View File

@@ -8,7 +8,7 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
namespace Jugenddienst_Stunden.Models;
class Auth {
public static async Task<string> GetApiDataWithAuthAsync(string url, string token) {
public static async Task<string?> GetApiDataWithAuthAsync(string url, string token) {
// Erstellen eines HttpClient-Objekts
using (HttpClient client = new HttpClient() { Timeout = TimeSpan.FromSeconds(15) }) {
@@ -62,7 +62,7 @@ class Auth {
string json = JsonSerializer.Serialize<DayTime>(item);
StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
HttpResponseMessage response = null;
HttpResponseMessage? response = null;
if (isNewItem)
response = await client.PostAsync(url, content);
else