Watch Pre-recorded Live Shows Here
Why Join
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Balwant Singh
1.8k
368
23.2k
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