Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Connection Refused

$
0
0

Connect to API Services From Xamarin form my android device . I have got a connection error (Connection refused)
"Your application "
public async Task RegisterAsync(string userName, string email, string password, string confirmPassword)
{
var client = new HttpClient();
var model = new RegisterBindingModel
{
UserName = userName,
Email = email,
Password = password,
ConfirmPassword = confirmPassword
};

        var json = JsonConvert.SerializeObject(model);

        HttpContent httpContent = new StringContent(json);

        httpContent.Headers.ContentType = new MediaTypeHeaderValue("Application/json");

        var response = await client.PostAsync("http://localhost:64111/api/account/register", httpContent);
        bool req;
        if (response.IsSuccessStatusCode)
        {
            req = true;
        }
        else
        {
            req = false;
        }

        return response.IsSuccessStatusCode;
    }



Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>