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)
评论列表
文章目录