aboutsummaryrefslogtreecommitdiffstats
path: root/docs/howto/usingurllib2.rst
diff options
context:
space:
mode:
authorTom Christie2012-08-25 19:53:10 +0100
committerTom Christie2012-08-25 19:53:10 +0100
commit00d3aa21ba3bd5524932a692b75053a24ecbebd2 (patch)
treef648ec1299d329eda9d6af2f0703d744df8252d6 /docs/howto/usingurllib2.rst
parent7d70948f9b348bdfd970dbd71c5ed2d02269ce3c (diff)
downloaddjango-rest-framework-00d3aa21ba3bd5524932a692b75053a24ecbebd2.tar.bz2
Updated sandbox links
Diffstat (limited to 'docs/howto/usingurllib2.rst')
-rw-r--r--docs/howto/usingurllib2.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/howto/usingurllib2.rst b/docs/howto/usingurllib2.rst
index 6320dc20..a14f8ddc 100644
--- a/docs/howto/usingurllib2.rst
+++ b/docs/howto/usingurllib2.rst
@@ -11,11 +11,11 @@ Here's an example which does a 'GET' on the `model-resource` example
in the sandbox.::
>>> import urllib2
- >>> r = urllib2.urlopen('htpp://rest.ep.io/model-resource-example')
+ >>> r = urllib2.urlopen('htpp://shielded-mountain-6732.herokuapp.com/model-resource-example')
>>> r.getcode() # Check if the response was ok
200
>>> print r.read() # Examin the response itself
- [{"url": "http://rest.ep.io/model-resource-example/1/", "baz": "sdf", "foo": true, "bar": 123}]
+ [{"url": "http://shielded-mountain-6732.herokuapp.com/model-resource-example/1/", "baz": "sdf", "foo": true, "bar": 123}]
Using the 'POST' method
-----------------------
@@ -29,11 +29,11 @@ to send the current time as as a string value for our POST.::
Now use the `Request` class and specify the 'Content-type'::
- >>> req = urllib2.Request('http://rest.ep.io/model-resource-example/', data=d, headers={'Content-Type':'application/x-www-form-urlencoded'})
+ >>> req = urllib2.Request('http://shielded-mountain-6732.herokuapp.com/model-resource-example/', data=d, headers={'Content-Type':'application/x-www-form-urlencoded'})
>>> resp = urllib2.urlopen(req)
>>> resp.getcode()
201
>>> resp.read()
- '{"url": "http://rest.ep.io/model-resource-example/4/", "baz": "Fri Dec 30 18:22:52 2011", "foo": false, "bar": 123}'
+ '{"url": "http://shielded-mountain-6732.herokuapp.com/model-resource-example/4/", "baz": "Fri Dec 30 18:22:52 2011", "foo": false, "bar": 123}'
That should get you started to write a client for your own api.