A
A
Anton20012021-07-24 12:23:45
C++ / C#
Anton2001, 2021-07-24 12:23:45

How to make a Post request on this site?

Hello, here is the correct browser post request (using fidler)

Code

POST https://www.evernote.com/Login.action HTTP/1.1
Host: www.evernote.com
Connection: keep-alive
Content-Length: 312
sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: https://www.evernote.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.evernote.com/Login.action?
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: cookieTestValue=1627117564397; JSESSIONID=5379FE34B92CB99F25A351A7D2951D4C; web50017PreUserGuid=c6c37862-3977-438e-b85d-4ee50c85db47; ak_wfSession=1627118164~id=3uV6dYOl0YhBl003CQebm3EyXFt2iqrabasrVaKr+b8=; ak_bmsc=E34D05341F5992A72D99DAC35137710F~000000000000000000000000000000~YAAQ1Jyb1a5EXLF6AQAARrLD1wyFm7E/kbRK2rj+0AHJr4sQf4IIq2pAzCgUIvBM/RwPDKune+ODVnJg+f5sw5tklZuz8rj07Op0aWkxY1IEdX28O000ndagaJMlcywZiWzg8qJhVT9EfgIoE632y8Y7t7LX65JA8KEoRpUhhF5voEkB0xa9CSSYd7l7N4CpSM6oklMyYxeX/skqs0OxuJo55y4D3ccHsUmqB9QRrQ7Gmpd+J/nqT9k+Ozsp0QuHnf9WAxpANvq51fGP+4y7+p38Q0ovPj2x5tbhacaiCYGUDYaYMoTWWNGdMXu/D20Pzp9zOJtjs8BTnLvOWBTWW/Lx9IMLr+CUvX4QYas/ZUqb5StDlK0waHID6jnYLQ==; _ga=GA1.2.332705815.1627117565; _gid=GA1.2.1466018889.1627117565; _gat=1; _gcl_au=1.1.1163619177.1627117565; optimizelyEndUserId=oeu1627117565471r0.6260001752289253; _uetsid=60800b60ec5e11eb8493856c44df00af; _uetvid=607ff5e0ec5e11eb9f43b32591df338a

username=user789456&evaluateUsername=&hpts=1627117564401&hptsh=ZasZ65oIey46PV9eROcAmWWUskk%3D&analyticsLoginOrigin=login_action&clipperFlow=false&showSwitchService=true&usernameImmutable=false&_sourcePage=04buozGZviviMUD9T65RG_YvRLZ-1eYO3fqfqRu0fynRL_1nukNa4gH1t86pc1SP&__fp=o_UvcCzCiTY3yWPvuidLz-TPR6I9Jhx8



And here is my code
request.KeepAlive = true;
                request.AddHeader("sec-ch-ua", "\" Not;A Brand\"; v = \"99\", \"Google Chrome\"; v = \"91\", \"Chromium\"; v = \"91\"");
                request.AddHeader("Accept", "application/json, text/javascript, */*; q=0.01");
                request.AddHeader("X-Requested-With", "XMLHttpRequest");
                request.AddHeader("sec-ch-ua-mobile", "?0");
                request.AddHeader("Origin", "https://www.evernote.com");
                request.AddHeader("Sec-Fetch-Site", "same-origin");
                request.AddHeader("Sec-Fetch-Mode", "cors");
                request.AddHeader("Sec-Fetch-Dest", "empty");
                request.Referer = "https://www.evernote.com/Login.action?";
                request.AddHeader(HttpHeader.AcceptLanguage, "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7");
                string post = request.Post("https://www.evernote.com/Login.action", "username=user789456&evaluateUsername=&hpts=" + hpts + "&hptsh=" + hptsh + "&analyticsLoginOrigin=login_action&clipperFlow=false&showSwitchService=true&usernameImmutable=false&_sourcePage=" + source_page + "&__fp=" + fp, "application/x-www-form-urlencoded; charset=UTF-8").ToString();

Throws an exception - Failed to load response from HTTP server 'www.evernote.com'
Although it seems that all the necessary headers have been added . hpts , hptsh etc parse and insert correctly .

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question