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
Balwant Singh
NA
373
33k
Unable to Consume Web Api in Xamarin
Feb 3 2020 12:11 AM
var keyValues = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("username", UserName),
new KeyValuePair<string, string>("password", Password),
new KeyValuePair<string, string>("grant_type", "password")
};
var request = new HttpRequestMessage(HttpMethod.Post, "http://softstacksolutions.in/Token");
request.Content = new FormUrlEncodedContent(keyValues);
var client = new HttpClient();
var response = await client.SendAsync(request);
var jwt = await response.Content.ReadAsStringAsync();
JObject jwtynamic = JsonConvert.DeserializeObject<dynamic>(jwt);
var accessToken = jwtynamic.Value<string>("access_token");
return accessToken;
this code works fine on simulator but faild but app crashes while this code is called
why?
Reply
Answers (
1
)
ELI5: Web Services
connectivity of xamp server error