: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():
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']
-__title__ = 'requests'
-__version__ = '0.0.1'
-__build__ = 0x000001
-__author__ = 'Dj Gilcrease'
-__license__ = 'ISC'
-__copyright__ = 'Copyright 2011 Kenneth Reitz'
+
+__all__ = [
+ 'Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete',
+ 'auth_manager', 'AuthObject','RequestException', 'AuthenticationError',
+ 'URLRequired', 'InvalidMethod', 'HTTPError'
+]
from .packages.poster.encode import multipart_encode
from .packages.poster.streaminghttp import register_openers
-__all__ = ['Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete', 'auth_manager', 'AuthObject',
- 'RequestException', 'AuthenticationError', 'URLRequired', 'InvalidMethod', 'HTTPError']
+
__title__ = 'requests'
__version__ = '0.2.5'
__build__ = 0x000205
-__author__ = 'Kenneth Reitz, Dj Gilcrease'
+__author__ = 'Kenneth Reitz'
__license__ = 'ISC'
__copyright__ = 'Copyright 2011 Kenneth Reitz'
+__all__ = [
+ 'Request', 'Response', 'request', 'get', 'head', 'post', 'put', 'delete',
+ 'auth_manager', 'AuthObject','RequestException', 'AuthenticationError',
+ 'URLRequired', 'InvalidMethod', 'HTTPError'
+]
+
+
class _Request(urllib2.Request):
"""Hidden wrapper around the urllib2.Request object. Allows for manual
setting of HTTP methods.
if self.error:
raise self.error
+
+
class AuthManager(object):
def __new__(cls):
singleton = cls.__dict__.get('__singleton__')
return r.response
+
def get(url, params={}, headers={}, cookies=None, auth=None):
"""Sends a GET request. Returns :class:`Response` object.
return request('DELETE', url, params=params, headers=headers, cookiejar=cookies, auth=auth)
+
+
class RequestException(Exception):
"""There was an ambiguous exception that occured while handling your
request."""