Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HttpClient httpClient = new HttpClient();
- var jsonReponse = await httpClient.GetStringAsync("http://localhost:xxxxx/api/LogIns");
- logInResult = JsonConvert.DeserializeObject<List<LogIn>>(jsonReponse);
- var logIn = new Models.LogIn()
- {
- Username = "username",
- Password = "password"
- };
- var logInJson = JsonConvert.SerializeObject(logIn);
- HttpClient httpClient = new HttpClient();
- var httpContent = new StringContent(logInJson);
- httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
- await httpClient.PostAsync("http://localhost:56267/api/LogIns", httpContent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement