Develop the connect between xamarin form to web api services through the http client RRS feed

  • Question

  • when we send the request through the http client the connect fail execption will appear 

    This is my code 

     var httpClient = new HttpClient();
                    HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:2051/api/TestAPI/UPDATEANDINSERTHHAVISIT1DALData");
                    var response = await httpClient.SendAsync(request);

                    //inner exception :  Error: ConnectFailure(Connection refused)

    kindly ans me if any one can now about it 

    or give me an alternative code 

    Thursday, October 26, 2017 1:04 PM

All replies

  • Hi 03214824603,

    Thank you for posting here.

    For your question is more related to Web API, you could post a new thread in Web API forum for suitable support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions. 

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 30, 2017 8:29 AM