Написание службы отдыха. Когда вы нажимаете клавишу, вам нужно вызвать метод регистрации пользователей. Я хотел бы указать номер телефона в теле запроса. Подскажите, как правильно назвать написанный метод? Спасибо!
public class RestService
{
private HttpClient client;
private object responseString;
public RestService()
{
client = new HttpClient();
}
public void UserRegistration()
{
var webUrl = "http://mysite/WebAPI/Register?app=CxTaxiWebAPI&phone=";
HttpRequestMessage request = new HttpRequestMessage();
request.RequestUri = new Uri(webUrl);
request.Method = HttpMethod.Get;
request.Content = new StringContent("+375293972740", Encoding.UTF8, "application/json");
}
}
public partial class MainPage : ContentPage
{
RestService _restService = new RestService();
public MainPage()
{
InitializeComponent();
}
private void EnterButton_Clicked(object sender, EventArgs e)
{
_restService.UserRegistration();
}
}