tornado AsyncHTTPClient() delete方法使用报错怎么解决
导读:本文共481.5字符,通常情况下阅读需要2分钟。同时您也可以点击右侧朗读,来听本文内容。按键盘←(左) →(右) 方向键可以翻页。
摘要:报错信息:tornado\simple_httpclient.py", line 365, in runraise KeyError("unknown method %s" % self.request.method)KeyError: 'unknown method delete'解决方案:需要在调用时设置allow_nonstandard_met... ...
音频解说
目录
(为您整理了一些要点),点击可以直达。报错信息:tornado\simple_httpclient.py", line 365, in run
raise KeyError("unknown method %s" % self.request.method)
KeyError: 'unknown method delete'
解决方案:需要在调用时设置allow_nonstandard_methods=True
asyncdef_do_action(self,**kwargs):
http_client=AsyncHTTPClient()
response=awaithttp_client.fetch(kwargs.get('url'),method=kwargs.get('method'),raise_error=False,
body=kwargs.get('data'),headers=kwargs.headers,
request_timeout=kwargs.request_timeout,allow_nonstandard_methods=True)returnresponse.body
方法默认allow_nonstandard_methods=True
本文:
tornado AsyncHTTPClient() delete方法使用报错怎么解决的详细内容,希望对您有所帮助,信息来源于网络。