Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 143 lines (88 sloc) 2.378 kb
97c548cb »
2012-04-01 All upload
1 .. _api:
2
3 API
4 ===
5
6 .. module:: requests
7
8 This part of the documentation covers all the interfaces of Requests. For
9 parts where Requests depends on external libraries, we document the most
10 important right here and provide links to the canonical documentation.
11
12
13 Main Interface
14 --------------
15
16 All of Request's functionality can be accessed by these 7 methods.
17 They all return an instance of the :class:`Response <Response>` object.
18
19 .. autofunction:: request
20
21 ---------------------
22
23
24 .. autoclass:: Response
25 :inherited-members:
26
27 ---------------------
28
29 .. autofunction:: head
30 .. autofunction:: get
31 .. autofunction:: post
32 .. autofunction:: put
33 .. autofunction:: patch
34 .. autofunction:: delete
35
36
37 -----------------
38
39 .. autofunction:: session
40
41
42
43 Exceptions
44 ~~~~~~~~~~
45
46 .. module:: requests
47
48 .. autoexception:: RequestException
49 .. autoexception:: ConnectionError
50 .. autoexception:: HTTPError
51 .. autoexception:: URLRequired
52 .. autoexception:: TooManyRedirects
53
54
55 .. _configurations:
56
57 Configurations
58 --------------
59
60 .. automodule:: requests.defaults
61
62
63 .. _async:
64
65 Async
66 -----
67
68 .. module:: requests.async
69
70
71 .. autofunction:: map
72 .. autofunction:: request
73 .. autofunction:: head
74 .. autofunction:: get
75 .. autofunction:: post
76 .. autofunction:: put
77 .. autofunction:: patch
78 .. autofunction:: delete
79
80
81
82 Utilities
83 ---------
84
85 These functions are used internally, but may be useful outside of
86 Requests.
87
88 .. module:: requests.utils
89
90 Status Code Lookup
91 ~~~~~~~~~~~~~~~~~~
92
93 .. autofunction:: requests.codes
94
95 ::
96
97 >>> requests.codes['temporary_redirect']
98 307
99
100 >>> requests.codes.teapot
101 418
102
103 >>> requests.codes['\o/']
104 200
105
106 Cookies
107 ~~~~~~~
108
109 .. autofunction:: dict_from_cookiejar
110 .. autofunction:: cookiejar_from_dict
111 .. autofunction:: add_dict_to_cookiejar
112
113
114 Encodings
115 ~~~~~~~~~
116
117 .. autofunction:: get_encodings_from_content
118 .. autofunction:: get_encoding_from_headers
119 .. autofunction:: get_unicode_from_response
120 .. autofunction:: decode_gzip
121
122
123 Internals
124 ---------
125
126 These items are an internal component to Requests, and should never be
127 seen by the end user (developer). This part of the API documentation
128 exists for those who are extending the functionality of Requests.
129
130
131 Classes
132 ~~~~~~~
133
134 .. autoclass:: requests.Response
135 :inherited-members:
136
137 .. autoclass:: requests.Request
138 :inherited-members:
139
140 .. _sessionapi:
141
142 .. autoclass:: requests.Session
143 :inherited-members:
144
Something went wrong with that request. Please try again.