Skip to content

Commit

Permalink
Merge pull request #274 from arthurdarcet/patch-1
Browse files Browse the repository at this point in the history
Implement the third example of the `POST multipart encoded file` of the documentation
  • Loading branch information
asvetlov committed Feb 16, 2015
2 parents d69ab74 + 282147a commit 5db7258
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 2 additions & 2 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def _gen_form_data(self, encoding='utf-8', chunk_size=8192):
for i in type_options.items())

out_headers.append(
('Content-Disposition: form-data; ' + opts).encode(encoding)
+ b'\r\n')
('Content-Disposition: form-data; ' + opts).encode(encoding) +
b'\r\n')

for k, v in headers.items():
out_headers.append('{}: {}\r\n'.format(k, v).encode(encoding))
Expand Down
9 changes: 0 additions & 9 deletions docs/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,6 @@ You can set the filename, content_type explicitly::

>>> yield from aiohttp.request('post', url, data=data)

If you want, you can send strings to be received as files::

>>> url = 'http://httpbin.org/post'
>>> files = {'file': ('report.csv',
... 'some,data,to,send\nanother,row,to,send\n')
... }

>>> yield from aiohttp.request('post', url, data=files)

If you pass file object as data parameter, aiohttp will stream it to server
automatically. Check :class:`aiohttp.stream.StreamReader` for supported format
information.
Expand Down

0 comments on commit 5db7258

Please sign in to comment.