c# - how to send get and post request in windows phone 8.1 -
i want implement , post request in windows phone 8.1 using c#.
i should able read text in url using request , must post in return give id set text have posted.
this code using post request.
private async void button_click(object sender, routedeventargs e) { windows.web.http.httpclient clientob = new windows.web.http.httpclient(); uri connectionurl = new uri("http://www.xyz.in/hoo/test.php/"); //text.text = pairs; dictionary<string, string> pairs = new dictionary<string, string>(); pairs.add("value1", "hello"); pairs.add("value2", "world!"); windows.web.http.httpformurlencodedcontent formcontent = new windows.web.http.httpformurlencodedcontent(pairs); windows.web.http.httpresponsemessage response = await clientob.postasync(connectionurl, formcontent); if (response.issuccessstatuscode) { var dialog = new messagedialog(response.content.tostring()); await dialog.showasync(); } }
in above code returns text on website.
Comments
Post a Comment