I have a website that calls __doPostBack for a specific link. I tried to load the page to which the link is being loaded, but manually enter the POST data, as well as manually set __EVENTTARGET and __EVENTARGUMENT, but I continue to receive the error page. If someone used the JSOUP library and found a workaround for this problem, please let me know. Here is the code to call the website with POST data:
Connection.Response res = Jsoup.connect("https://parentaccess.ocps.net/Progress/ProgressSummary.aspx?T=2").data(target.substring(0,target.length()-5)+"txtClass_DBID",dBID).data("__LASTFOCUS","").data("__EVENTVALIDATION", eventValidation).data("__VIEWSTATE", viewState).cookie("ASP.NET_SessionId", cookie).data("__EVENTTARGET",target).data("DropDownListGradingPeriod","3").data("__EVENTARGUMENT","").header("Content-Type","text/html; charset=utf-8").header("Connection", "keep-alive").header("Cache-Control", "private").method(Method.POST).execute();
Document doc = res.parse();
Document doc2 = Jsoup.connect("https://parentaccess.ocps.net/Progress/ProgressDetails.aspx").data(target.substring(0,target.length()-5)+"txtClass_DBID",dBID).data("__LASTFOCUS","").data("__EVENTVALIDATION", eventValidation).data("__VIEWSTATE", viewState).cookie("ASP.NET_SessionId", cookie).data("__EVENTTARGET",target).data("DropDownListGradingPeriod","3").data("__EVENTARGUMENT","").header("Content-Type","text/html; charset=utf-8").header("Connection", "keep-alive").header("Cache-Control", "private").get();
Please note that I tried both Connection.Response and JSOUP.connect with POST data, but got errors for doc2 (res loads the page, but the information should not be transmitted because a table with POST data is not created). Thanks!
source
share