Полный рефакторинг api. Вынесено отдельно api passport
This commit is contained in:
19
YandexMusic.API/Requests/Passport/YCheckSessionBuilder.cs
Normal file
19
YandexMusic.API/Requests/Passport/YCheckSessionBuilder.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using YandexMusic.API.Models.Passport;
|
||||
|
||||
namespace YandexMusic.API.Requests.Passport;
|
||||
|
||||
internal class YCheckSessionBuilder : YPassportRequestBuilder<YPassportSessionStatus?, object>
|
||||
{
|
||||
public YCheckSessionBuilder(YandexMusicApi api) : base(api) { }
|
||||
|
||||
protected override string Method => WebRequestMethods.Http.Post;
|
||||
protected override string PathTemplate => "pwl-yandex/api/passport/sessions/check_session";
|
||||
|
||||
protected override HttpContent? GetContent(object _)
|
||||
{
|
||||
var data = new { track_id = Api.Storage.AuthToken.TrackId };
|
||||
return JsonContent.Create(data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user