Files
YandexMusic/YandexMusic.API/Requests/Account/YGetAuthLoginCaptchaBuilder.cs

13 lines
695 B
C#

using System.Net;
using YandexMusic.API.Models.Account;
namespace YandexMusic.API.Requests.Account;
internal class YGetAuthLoginCaptchaBuilder : YPassportRequestBuilder<YAuthBase?, string>
{
public YGetAuthLoginCaptchaBuilder(YandexMusicApi api) : base(api) { }
protected override string Method => WebRequestMethods.Http.Post;
protected override string PathTemplate => "registration-validations/checkHuman";
protected override HttpContent? GetContent(string captchaAnswer)
=> new FormUrlEncodedContent(new Dictionary<string, string> { { "csrf_token", Api.Storage.AuthToken.CsfrToken }, { "track_id", Api.Storage.AuthToken.TrackId }, { "answer", captchaAnswer } });
}