H
H
Hirty2016-05-22 10:40:53
WPF
Hirty, 2016-05-22 10:40:53

WebClient request 400 error?

string url = html;//html- указывается адрес сайта
                    using (var webClient = new WebClient())
                    {
                        var pars = new NameValueCollection();
                        pars.Add("_csrf", connetn);//connetn предварительно спарсил данные 
                        pars.Add("SignupForm[track_id]", "");
                        pars.Add("SignupForm[su_type]", "partner");
                        pars.Add("SignupForm[anonymously]", "0");
                        pars.Add("SignupForm[username]", "123456789yrtytr");
                        pars.Add("SignupForm[email]", "[email protected]");
                        pars.Add("SignupForm[password]", "41526300");
                        pars.Add("SignupForm[repeatpassword]", "41526300");
                        pars.Add("track_id", "0");
                        var response = webClient.UploadValues(url, pars);
                        if (response == null)
                        {
                            label1.Content = "2";
                            return;
                        }
                        else
                        {
                            label.Content = "1";
                        }
                    }

Error 400. Bad request.
7dcc6435cfd8242add33c78eea6c7041.png
Here is the request.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#algooptimize #bottize, 2016-05-22
@user004

sniffer in hand, if everything is ok, then write to the site developers.
Chewed the first question as best he could, watch the second one with a sniffer?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question