Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User
- {
- public String first_name;
- public String last_name;
- public String username;
- public String password;
- }
- private void Next_Click(object sender, RoutedEventArgs e)
- {
- String name = nameTxtBox.Text;
- String lastName = textBoxSecondName.Text;
- String login = firstNameTxtBox.Text;
- String passwordt = lastNameTxtBox.Text;
- var client = new RestClient("http://95.85.24.237:8081");
- var request = new RestRequest("/user/new", Method.POST);
- request.RequestFormat = RestSharp.DataFormat.Json;
- request.AddBody(new User {
- first_name = name,
- last_name = lastName,
- username = login,
- password = passwordt,
- });
- IRestResponse response = client.Execute(request);
- var content = response.Content;
- MessageBox.Show(content);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement