search

Home  >  Q&A  >  body text

python - requests post problem

The post data is: POWER_INFO.XML=(1,3)
I use 'POWER_INFO.XML':'(1,3)' to send data but no operation is performed. Is there something wrong with my writing?
When I used Yi Language Post to test, the data could be executed successfully.

Attached code:

            s = requests.Session()
            headers={'Cookie': 'langSetFlag=0; language=English; SID=ntnfkcvpmqfhmfnt; mainpage=remote; subpage=man_chassis'}
            requests.packages.urllib3.disable_warnings()
            try:
                r=s.post('https://'+self.ip.text()+'/cgi/login.cgi', data={'name':  self.zh.text(), 'pwd': self.mm.text()},headers=headers,verify=False) 
                self.IPMI_4.setText("成功")
                rr=s.post('https://'+self.ip.text()+'/cgi/ipmi.cgi', data={'POWER_INFO.XML':'(1%2C3)'},headers=headers,verify=False)
                print(rr.text)
                print(rr.headers)
            except requests.exceptions.ConnectionError:
                self.IPMI_4.setText("失败")
漂亮男人漂亮男人2825 days ago629

reply all(1)I'll reply

  • 阿神

    阿神2017-05-18 10:50:23

    It’s done, just change POWER_INFO. . .

    reply
    0
  • Cancelreply