summaryrefslogtreecommitdiff
path: root/docs/user/quickstart.rst
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2012-12-23 02:42:14 -0500
committerKenneth Reitz <me@kennethreitz.com>2012-12-23 02:42:14 -0500
commit5b5ff6920102e013cf041bd342459e4e0613294f (patch)
tree37b5b388eea85e4190e5eb41d3cb51d549c2a0d7 /docs/user/quickstart.rst
parent066512900897d4092846529e7017df99a0aece6b (diff)
downloadpython-requests-5b5ff6920102e013cf041bd342459e4e0613294f.tar.gz
update docsv1.0.4
Diffstat (limited to 'docs/user/quickstart.rst')
-rw-r--r--docs/user/quickstart.rst18
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst
index 183c89d6..36246310 100644
--- a/docs/user/quickstart.rst
+++ b/docs/user/quickstart.rst
@@ -19,7 +19,7 @@ Let's get started with some simple examples.
Make a Request
-------------------
+--------------
Making a request with Requests is very simple.
@@ -175,12 +175,12 @@ dictionary of data will automatically be form-encoded when the request is made::
>>> r = requests.post("http://httpbin.org/post", data=payload)
>>> print r.text
{
- // ...snip... //
+ ...
"form": {
"key2": "value2",
"key1": "value1"
},
- // ...snip... //
+ ...
}
There are many times that you want to send data that is not form-encoded. If you pass in a ``string`` instead of a ``dict``, that data will be posted directly.
@@ -205,11 +205,11 @@ Requests makes it simple to upload Multipart-encoded files::
>>> r = requests.post(url, files=files)
>>> r.text
{
- // ...snip... //
+ ...
"files": {
"file": "<censored...binary...data>"
},
- // ...snip... //
+ ...
}
You can set the filename explicitly::
@@ -220,11 +220,11 @@ You can set the filename explicitly::
>>> r = requests.post(url, files=files)
>>> r.text
{
- // ...snip... //
+ ...
"files": {
"file": "<censored...binary...data>"
},
- // ...snip... //
+ ...
}
If you want, you can send strings to be received as files::
@@ -235,11 +235,11 @@ If you want, you can send strings to be received as files::
>>> r = requests.post(url, files=files)
>>> r.text
{
- // ...snip... //
+ ...
"files": {
"file": "some,data,to,send\\nanother,row,to,send\\n"
},
- // ...snip... //
+ ...
}