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