Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1.  class User
  2.     {
  3.        public String first_name;
  4.         public String last_name;
  5.         public String username;
  6.         public String password;
  7.  
  8.      
  9.     }
  10.  
  11.  
  12. private void Next_Click(object sender, RoutedEventArgs e)
  13.         {
  14.            
  15.  
  16.             String name = nameTxtBox.Text;
  17.             String lastName = textBoxSecondName.Text;
  18.             String login = firstNameTxtBox.Text;
  19.             String passwordt = lastNameTxtBox.Text;
  20.  
  21.             var client = new RestClient("http://95.85.24.237:8081");
  22.             var request = new RestRequest("/user/new", Method.POST);
  23.             request.RequestFormat = RestSharp.DataFormat.Json;
  24.             request.AddBody(new User {
  25.                 first_name = name,
  26.                 last_name = lastName,
  27.                 username = login,
  28.                 password = passwordt,
  29.              
  30.     });
  31.  
  32.             IRestResponse response =  client.Execute(request);
  33.  
  34.             var content = response.Content;
  35.  
  36.          
  37.  
  38.  
  39.             MessageBox.Show(content);
  40.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement