http post to login in c# -
i'm noob in c# programming. i want implement http post login on web server. correct implemetation (test advanced rest) http post http://localhost:8080/pentaho/j_spring_security_check "j_username=admin&j_password=password" payload , application encoded content type . advanced rest, server responses 302 , redirects home (and right way). i tried implement same thing in c# code (copied google) server responsens 500 .... here code: public partial class webform1 : system.web.ui.page { private static readonly httpclient client = new httpclient(); protected void page_load(object sender, eventargs e) { } private void dorequest() { // create request using url can receive post. webrequest request = webrequest.create("http://localhost:8080/pentaho/j_spring_security_check"); // set method property of request post. request.method = "post"; // create post data , convert byte a