How to check for an HTTP status code of 401?

后端 未结 4 1412
我在风中等你
我在风中等你 2020-12-22 06:27

In one of the answers that I have received here, I encountered a problem of not knowing how to pass automatically through \"Google App Engines\" my ID and a password to a we

4条回答
  •  佛祖请我去吃肉
    2020-12-22 07:04

    You are not getting 401 because that site is not returning 401 but 200 always. Usually type of coding we do for websites is return 200 with a page saying "Please login..blah blah", if site returned anything other then 200 browser will not display the funky error msg.

    So in short as i mentioned in other question, you need to look into login page, see what params it uses e.g login=xxx, password=yyy, post it to that page and you will have to manage the cookies too, that is where library like twill etc come into picture.

提交回复
热议问题