got Validation of viewstate MAC failed when sending post request from google app engine via url fetch service

前端 未结 2 1964
半阙折子戏
半阙折子戏 2021-01-20 03:49

I have a task to fetch html from a website, before I go to that page I need to log in.

I use a low-level api url fetch service. Here is my code test code:



        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-20 04:42

    Commonly, when you're trying to emulate a postBack on the asp.net, you need to POST:

    • preserved from the first request cookies to act on the same session
    • data fields (login, password)
    • hidden ones from the first page: __VIEWSTATE, __VIEWSTATEENCRYPTED (even if it's empty!), __EVENTVALIDATION
    • if you sending some action items, maybe you need to include also hidden fields __EVENTTARGET and __EVENTARGUMENT

提交回复
热议问题