Async HTTP request using GIO

牧云@^-^@ 提交于 2019-12-14 02:18:18

问题


I would appreciate an example on how to perform an async HTTP POST request using Python's GIO binding.

Edit: Example sought without using Twisted.


回答1:


An example using Twisted Deferred objects is available on James Henstridge's blog.




回答2:


Sorry this is not HTTP POST (just GET), but it is using Gio to asynchronously request a URL, with a callback that processes the resulting data when it's done downloading.

https://github.com/robru/gottengeography/blob/65505bd0cf0060ec7397849e7c62c231367c7f1d/gg/datatypes.py#L242



来源:https://stackoverflow.com/questions/2134797/async-http-request-using-gio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!