1# -*- coding: utf-8 -*-
2
3#   __
4#  /__)  _  _     _   _ _/   _
5# / (   (- (/ (/ (- _)  /  _)
6#          /
7
8"""
9Requests HTTP library
10~~~~~~~~~~~~~~~~~~~~~
11
12Requests is an HTTP library, written in Python, for human beings. Basic GET
13usage:
14
15   >>> import requests
16   >>> r = requests.get('https://www.python.org')
17   >>> r.status_code
18   200
19   >>> 'Python is a programming language' in r.content
20   True
21
22... or POST:
23
24   >>> payload = dict(key1='value1', key2='value2')
25   >>> r = requests.post('http://httpbin.org/post', data=payload)
26   >>> print(r.text)
27   {
28     ...
29     "form": {
30       "key2": "value2",
31       "key1": "value1"
32     },
33     ...
34   }
35
36The other HTTP methods are supported - see `requests.api`. Full documentation
37is at <http://python-requests.org>.
38
39:copyright: (c) 2015 by Kenneth Reitz.
40:license: Apache 2.0, see LICENSE for more details.
41
42"""
43
44__title__ = 'requests'
45__version__ = '2.9.1'
46__build__ = 0x020901
47__author__ = 'Kenneth Reitz'
48__license__ = 'Apache 2.0'
49__copyright__ = 'Copyright 2015 Kenneth Reitz'
50
51# Attempt to enable urllib3's SNI support, if possible
52try:
53    from .packages.urllib3.contrib import pyopenssl
54    pyopenssl.inject_into_urllib3()
55except ImportError:
56    pass
57
58from . import utils
59from .models import Request, Response, PreparedRequest
60from .api import request, get, head, post, patch, put, delete, options
61from .sessions import session, Session
62from .status_codes import codes
63from .exceptions import (
64    RequestException, Timeout, URLRequired,
65    TooManyRedirects, HTTPError, ConnectionError,
66    FileModeWarning,
67)
68
69# Set default logging handler to avoid "No handler found" warnings.
70import logging
71try:  # Python 2.7+
72    from logging import NullHandler
73except ImportError:
74    class NullHandler(logging.Handler):
75        def emit(self, record):
76            pass
77
78logging.getLogger(__name__).addHandler(NullHandler())
79
80import warnings
81
82# FileModeWarnings go off per the default.
83warnings.simplefilter('default', FileModeWarning, append=True)
84