Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
e44f182f
Commit
e44f182f
authored
Dec 30, 2011
by
Marko Tibold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typos
parent
e82ab8ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
docs/howto/usingurllib2.rst
+3
-3
No files found.
docs/howto/usingurllib2.rst
View file @
e44f182f
...
@@ -4,15 +4,15 @@ Using urllib2
...
@@ -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` exam
p
le
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 res
p
onse 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}]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment