mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 11:33:59 +03:00
typos
This commit is contained in:
parent
e82ab8ea31
commit
e44f182fcf
|
@ -4,15 +4,15 @@ Using urllib2
|
||||||
Python's standard library comes with some nice modules
|
Python's standard library comes with some nice modules
|
||||||
you can use to test your api or even write a full client.
|
you can use to test your api or even write a full client.
|
||||||
|
|
||||||
Here's an example which does a 'GET' on the `model-resource` examle
|
Here's an example which does a 'GET' on the `model-resource` example
|
||||||
in the sandbox.::
|
in the sandbox.::
|
||||||
|
|
||||||
import urllib2
|
>>> import urllib2
|
||||||
>>> r = urllib2.urlopen('htpp://rest.ep.io/model-resource-example')
|
>>> r = urllib2.urlopen('htpp://rest.ep.io/model-resource-example')
|
||||||
# You can check if the response was ok:
|
# You can check if the response was ok:
|
||||||
>>> r.getcode()
|
>>> r.getcode()
|
||||||
200
|
200
|
||||||
# Or examin the resonse itself:
|
# Or examin the response itself:
|
||||||
>>> print r.read()
|
>>> print r.read()
|
||||||
[{"url": "http://rest.ep.io/model-resource-example/1/", "baz": "sdf", "foo": true, "bar": 123}]
|
[{"url": "http://rest.ep.io/model-resource-example/1/", "baz": "sdf", "foo": true, "bar": 123}]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user