You need to sign in to do that
Don't have an account?

Why can't access rest api from xamarin?
I access rest api from xamarin:
**Result: **
In android, i using okhttp,it is ok. But In xamarin, i using httpclient, it can't.
How can access salesforce Rest API from xamarin?
HttpClient client = new HttpClient(); var RestUrl = "https://login.salesforce.com/services/oauth2/token"; var uri = new Uri(string.Format(RestUrl, string.Empty)); UserInfo us = new UserInfo(); us.grant_type = "password"; us.client_id = "3MVG9YDQS5WtC11oHZF7qKDt4DyviHkb06byPkwfg_IqruHnLswqi6U23IXZUtGqGW4.ouwAaBxwxf....."; us.client_secret = "4085120398336......"; us.username = "vnit12345@gmail.com"; us.password = "123456dHfSkURI2khlRYpOoq7u....."; var json = JsonConvert.SerializeObject(us); var content = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(uri, content);
**Result: **
_StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:_
In android, i using okhttp,it is ok. But In xamarin, i using httpclient, it can't.
How can access salesforce Rest API from xamarin?