tornado AsyncHTTPClient() delete方法使用报错怎么解决(asynchttpclient(),delete,tornado,web开发)

时间:2024-05-08 08:20:06 作者 : 石家庄SEO 分类 : web开发
  • TAG :

报错信息: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方法使用报错怎么解决

本文:tornado AsyncHTTPClient() delete方法使用报错怎么解决的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:tornado执行asyncio异步报错run_forever assert self._self_reading_future is None如何解决下一篇:

5 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18