mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 15:28:28 +01:00
Use PostAsJsonAsync where possible
This commit is contained in:
@@ -63,8 +63,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
|
||||
Name = "ThisProfileDoesNotExist"
|
||||
};
|
||||
|
||||
using var content = JsonContent.Create(deviceProfile, options: _jsonOptions);
|
||||
using var getResponse = await client.PostAsync("/Dlna/Profiles/" + NonExistentProfile, content).ConfigureAwait(false);
|
||||
using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles/" + NonExistentProfile, deviceProfile, _jsonOptions).ConfigureAwait(false);
|
||||
Assert.Equal(HttpStatusCode.NotFound, getResponse.StatusCode);
|
||||
}
|
||||
|
||||
@@ -80,8 +79,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
|
||||
Name = "ThisProfileIsNew"
|
||||
};
|
||||
|
||||
using var content = JsonContent.Create(deviceProfile, options: _jsonOptions);
|
||||
using var getResponse = await client.PostAsync("/Dlna/Profiles", content).ConfigureAwait(false);
|
||||
using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles", deviceProfile, _jsonOptions).ConfigureAwait(false);
|
||||
Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode);
|
||||
}
|
||||
|
||||
@@ -119,8 +117,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
|
||||
Id = _newDeviceProfileId
|
||||
};
|
||||
|
||||
using var content = JsonContent.Create(updatedProfile, options: _jsonOptions);
|
||||
using var getResponse = await client.PostAsync("/Dlna/Profiles", content).ConfigureAwait(false);
|
||||
using var getResponse = await client.PostAsJsonAsync("/Dlna/Profiles", updatedProfile, _jsonOptions).ConfigureAwait(false);
|
||||
Assert.Equal(HttpStatusCode.NoContent, getResponse.StatusCode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user