locked
Help with simple Web Request in C#

    Question

  • Hello all.

    I've got an app which contains two buttons Turn On and Turn Off. How to make a web request when I click on button Turn On ? It should sends a web request which looks like that http://192.168.1.233/index.php?action=turnon and when I click on Turn Off button it should sends a request http://192.168.1.233/index.php?action=turnoff.

    Thank you for every reply :)



    Thursday, July 31, 2014 9:28 PM

Answers

  • use the HttpClient class?

    HttpClient client = new HttpClient();

    stirng result = await client.GetAsync(new Uri("http://192.168.1.233/index.php?action=turnon "))

    in your manifest turn on capability for private networks


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Friday, August 01, 2014 8:07 AM

All replies

  • Hi,

    I am not clear about your query.

    You are just adding action to URL otherwise everything is same.

    Try out this


    -Malleswar

    Thursday, July 31, 2014 11:51 PM
  • use the HttpClient class?

    HttpClient client = new HttpClient();

    stirng result = await client.GetAsync(new Uri("http://192.168.1.233/index.php?action=turnon "))

    in your manifest turn on capability for private networks


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Friday, August 01, 2014 8:07 AM