Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Mar 11, 2015
1 parent 14f9b05 commit f3ad52d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,41 @@ Getting started
Client
^^^^^^

To retrieve something from the web::
To retrieve something from the web:

.. code-block:: python
import aiohttp
def get_body(url):
response = yield from aiohttp.request('GET', url)
return (yield from response.read())
You can use the get command like this anywhere in your ``asyncio``
powered program::
powered program:

.. code-block:: python
response = yield from aiohttp.request('GET', 'http://python.org')
body = yield from response.read()
print(body)
If you want to use timeouts for aiohttp client side please use standard
asyncio approach::
asyncio approach:

.. code-block:: python
yield from asyncio.wait_for(request('GET', url), 10)
Server
Server
^^^^^^

In aiohttp 0.12 we've added highlevel API for web HTTP server.

There is simple usage example::
There is simple usage example:

.. code-block:: python
import asyncio
from aiohttp import web
Expand Down

0 comments on commit f3ad52d

Please sign in to comment.