0

Advise useful python library for work with http with cookies and different methods (GET, POST, etc) like requests.

The main criterions is useful and simplicity. Would very much like to work with library asynchronously by gevent or eventlet.

UPD: I dont want to use requests because it is not work asynchronously: how enable requests async mode?

UPD2: In requests refused urllib2 to urllib3. I think to use urllib2 is bad way. This is not to mention the fact that it is useful.

Community
  • 1
  • 1
user12397901
  • 460
  • 1
  • 4
  • 14

3 Answers3

2

Requests fully support asynchronous requests.

Here's more information in the docs:

http://docs.python-requests.org/en/latest/user/advanced/#asynchronous-requests

Kenneth Reitz
  • 8,559
  • 4
  • 31
  • 34
0

Eventlet and Gevent are both compatible with urllib2 and cookielib, which both depend on the automatically patched socket module and should be able to work with different request methods and cookies.

With eventlet, you only need:

import eventlet
from eventlet.green import urllib2
import cookielib 

and with gevent, you only need:

from gevent import monkey; monkey.patch_socket()
import urllib2, cookielib

Those solutions will make both urllib2 and cookielib thread-safe.

enderskill
  • 7,354
  • 3
  • 24
  • 23
0

Have you looked at cookielib?

Tre Jones
  • 61
  • 2
  • Yes, I looked this when only start finding some libraries for http. But, I refused this because it is so hard for using versus requests. – user12397901 Feb 29 '12 at 22:47