N
N
Nikolay2015-08-20 08:48:43
OAuth
Nikolay, 2015-08-20 08:48:43

Authorization oAuth VK API. How to make a correct POST request?

I can't log in to the application via VKAPI.
I get an authorization form, fill in the required fields and send POST, when I view the response in the debugger, I again display an authorization form with a field (incorrect login or password), although everything is correct. There is a suspicion that I form Post incorrectly.
I installed Fiddler, I start debugging through it, I can’t send an authorization request at all

byte[] b =
                Encoding.UTF8.GetBytes(String.Join("&",
                    from item in qs.AllKeys select item + "=" + qs[item]));

            request = (HttpWebRequest)WebRequest.Create("https://login.vk.com/?act=login&soft=1&utf8=1");
            request.CookieContainer = new CookieContainer();
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = b.Length;
            request.GetRequestStream().Write(b, 0, b.Length);
            request.AllowAutoRedirect = false;
            response = (HttpWebResponse)request.GetResponse();//При использование Fiddlera  возникает ошибка
            reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
            string HTML = reader.ReadToEnd();
            cookieContainer = new CookieContainer();
            foreach (Cookie c in response.Cookies)
            {
                cookieContainer.Add(c);
            }

Can you tell me what is wrong with the request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tsiren Naimanov, 2015-08-20
@ImmortalCAT

why a bike?
full of vkapi on sharpe
for regular apples, for middleware asp.net mvc Auth2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question