1 # -*- coding: utf-8 -*-
5 # / ( (- (/ (/ (- _) / _)
12 Requests is an HTTP library, written in Python, for human beings. Basic GET
16 >>> r = requests.get('https://www.python.org')
19 >>> 'Python is a programming language' in r.content
24 >>> payload = dict(key1='value1', key2='value2')
25 >>> r = requests.post('http://httpbin.org/post', data=payload)
36 The other HTTP methods are supported - see `requests.api`. Full documentation
37 is at <http://python-requests.org>.
39 :copyright: (c) 2016 by Kenneth Reitz.
40 :license: Apache 2.0, see LICENSE for more details.
44 __title__ = 'requests'
45 __version__ = '2.10.0'
47 __author__ = 'Kenneth Reitz'
48 __license__ = 'Apache 2.0'
49 __copyright__ = 'Copyright 2016 Kenneth Reitz'
51 # Attempt to enable urllib3's SNI support, if possible
53 from .packages.urllib3.contrib import pyopenssl
54 pyopenssl.inject_into_urllib3()
60 # urllib3's DependencyWarnings should be silenced.
61 from .packages.urllib3.exceptions import DependencyWarning
62 warnings.simplefilter('ignore', DependencyWarning)
65 from .models import Request, Response, PreparedRequest
66 from .api import request, get, head, post, patch, put, delete, options
67 from .sessions import session, Session
68 from .status_codes import codes
69 from .exceptions import (
70 RequestException, Timeout, URLRequired,
71 TooManyRedirects, HTTPError, ConnectionError,
72 FileModeWarning, ConnectTimeout, ReadTimeout
75 # Set default logging handler to avoid "No handler found" warnings.
78 from logging import NullHandler
80 class NullHandler(logging.Handler):
81 def emit(self, record):
84 logging.getLogger(__name__).addHandler(NullHandler())
88 # FileModeWarnings go off per the default.
89 warnings.simplefilter('default', FileModeWarning, append=True)