TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
611
127.1k
Login web api consume.
Dec 22 2020 7:34 AM
Hello EveryOne i'm new in .net core .How to consume a login web api in .net core
client.BaseAddress = new Uri("http://abc.abc.com/");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.PostAsJsonAsync("api/LoginRegister/LoginUser", login).Result;
//var contents = response.Content.ReadAsAsync<AuthToken>().Result;
var contents = response.Content.ReadAsStringAsync().Result;
if (response.IsSuccessStatusCode)
{
//HttpContext.Session.SetString("AdminName", contents.);
//HttpContext.Session.SetString("AdminRoleId", Convert.ToString(admindetails.RoleId));
//HttpContext.Session.SetString("AdminId", Convert.ToString(admindetails.UserId));
//HttpContext.Session.SetString("AdminImage", Convert.ToString(admindetails.UserProfilePic));
TempData["msg"] = "Login Successfully";
return RedirectToAction("Dashboard", "Dashboard");
I have use this code but not login.Please Help me
Reply
Answers (
2
)
One column is not displaying in KENDO Grid
Bind dropdown with json data in mvc