webservice client - Sending POST request to a web server in Windows Phone 8 -
i making windows phone 8 application need send login credentials web server(i using restsharp) , post authentication (response) , have variety of tasks. using following code base getting not acceptable error message.
var client = new restclient("http://com.example"); var request = new restrequest("/resource/", method.post); // json post request.addparameter("username", username.text); request.addparameter("password", password.text); request.addheader("content-type", "application/x-www-form-urlencoded"); client.executeasync(request, response => { messagebox.show(response.statuscode.tostring()); if (response != null && ((response.statuscode == httpstatuscode.ok) && (response.responsestatus == responsestatus.completed))) // it's not necessary test both { } else if (response != null) { messagebox.show(string.format ("status code {0} ({1}); response status {2}", response.statuscode, response.statusdescription, response.responsestatus)); } }); i tried httpresponsemessage part of httpclient , dont know how send post .
Comments
Post a Comment