Cmain_window.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:ChenSpiderGUI 作者: chenyansu 项目源码 文件源码
def requests_method(self):
        # ????????????????????
        httpmthdcmbbx = ui.httpmthdcmbbx
        httpmthd_1 = httpmthdcmbbx.currentText()
        httpmthdlnedt = ui.httpmthdlnedt
        httpmthd_2 = httpmthdlnedt.text()
        dlwthrspnscmbbx = ui.dlwthrspnscmbbx
        httpmthd_3 = dlwthrspnscmbbx.currentText()

        global r

        # ?????
        if httpmthd_1 == "get":
            r = requests.get(self.url, httpmthd_2)
        elif httpmthd_1 == "post":
            r = requests.post(self.url, httpmthd_2)
        elif httpmthd_1 == "put":
            r = requests.put(self.url, httpmthd_2)
        elif httpmthd_1 == "delete":
            r = requests.delete(self.url, httpmthd_2)
        elif httpmthd_1 == "head":
            r = requests.head(self.url)
        else:
            r = requests.options(self.url, httpmthd_2)

        # ???????
        if httpmthd_3 == "????????":
            print(r.text)
        elif httpmthd_3 == "?????????":
            print(r.content)
        elif httpmthd_3 == "??json????":
            print(r.json)
        else:
            pass

        messages.append(r.text)
        ui.showmssg.setText('\n'.join(messages))
        print(httpmthd_1)
        print(httpmthd_2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号