You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.3 KiB
60 lines
1.3 KiB
# -*- coding: utf-8 -*-
|
|
|
|
# __
|
|
# /__) _ _ _ _ _/ _
|
|
# / ( (- (/ (/ (- _) / _)
|
|
# /
|
|
|
|
"""
|
|
requests HTTP library
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Requests is an HTTP library, written in Python, for human beings. Basic GET
|
|
usage:
|
|
|
|
>>> import requests
|
|
>>> r = requests.get('http://python.org')
|
|
>>> r.status_code
|
|
200
|
|
>>> 'Python is a programming language' in r.content
|
|
True
|
|
|
|
... or POST:
|
|
|
|
>>> payload = dict(key1='value1', key2='value2')
|
|
>>> r = requests.post("http://httpbin.org/post", data=payload)
|
|
>>> print r.text
|
|
{
|
|
...
|
|
"form": {
|
|
"key2": "value2",
|
|
"key1": "value1"
|
|
},
|
|
...
|
|
}
|
|
|
|
The other HTTP methods are supported - see `requests.api`. Full documentation
|
|
is at <http://python-requests.org>.
|
|
|
|
:copyright: (c) 2012 by Kenneth Reitz.
|
|
:license: ISC, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
__title__ = 'requests'
|
|
__version__ = '0.14.1'
|
|
__build__ = 0x001401
|
|
__author__ = 'Kenneth Reitz'
|
|
__license__ = 'ISC'
|
|
__copyright__ = 'Copyright 2012 Kenneth Reitz'
|
|
|
|
|
|
from . import utils
|
|
from .models import Request, Response
|
|
from .api import request, get, head, post, patch, put, delete, options
|
|
from .sessions import session, Session
|
|
from .status_codes import codes
|
|
from .exceptions import (
|
|
RequestException, Timeout, URLRequired,
|
|
TooManyRedirects, HTTPError, ConnectionError
|
|
)
|
|
|