mirror of
https://github.com/kennethreitz/requests3.git
synced 2026-06-05 23:10:16 +00:00
46 lines
878 B
Python
46 lines
878 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
requests.core
|
|
~~~~~~~~~~~~~
|
|
|
|
This module implements the main Requests system.
|
|
|
|
:copyright: (c) 2011 by Kenneth Reitz.
|
|
:license: ISC, see LICENSE for more details.
|
|
"""
|
|
|
|
|
|
from __future__ import absolute_import
|
|
import urllib
|
|
import urllib2
|
|
from urllib2 import HTTPError
|
|
|
|
|
|
try:
|
|
import eventlet
|
|
eventlet.monkey_patch()
|
|
except ImportError:
|
|
pass
|
|
|
|
if not 'eventlet' in locals():
|
|
try:
|
|
from gevent import monkey
|
|
monkey.patch_all()
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
if not 'eventlet' in locals():
|
|
raise ImportError('No Async adaptations of urllib2 found!')
|
|
|
|
|
|
from .core import *
|
|
|
|
|
|
__all__ = [
|
|
'Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete',
|
|
'auth_manager', 'AuthObject','RequestException', 'AuthenticationError',
|
|
'URLRequired', 'InvalidMethod', 'HTTPError'
|
|
]
|