Merge branch 'master' into basic-auth

This commit is contained in:
Zbigniew Siciarz
2011-06-13 15:34:23 +02:00
3 changed files with 20 additions and 7 deletions
+13
View File
@@ -0,0 +1,13 @@
HttpBin is written and maintained by Kenneth Reitz and
various contributors:
Development Lead
````````````````
- Kenneth Reitz <_@kennethreitz.com>
Patches and Suggestions
```````````````````````
- Zbigniew Siciarz
+2 -2
View File
@@ -15,13 +15,13 @@ httpbin(1): HTTP Client Testing Service
`/status/:code` Returns given HTTP Status code.
`/redirect/:n` 302 Redirects *n* times.
`/cookies` Returns cookie data.
`/set-cookie/:name/:value` Sets a simple cookie.
`/cookies/set/:name/:value` Sets a simple cookie.
## DESCRIPTION
Testing an HTTP Library can become difficult sometimes. PostBin.org is fantastic
for testing POST requests, but not much else. This exists to cover all kinds of HTTP
for testing POST requests, but not much else. This exists to cover all kinds of HTTP
scenarios. Additional endpoints are being considered: `/basic-auth`, `/deflate`, *&c*.
All endpoint responses are JSON-encoded.
+5 -5
View File
@@ -183,17 +183,17 @@ def view_status_code(code):
def view_cookies():
"""Returns cookie data."""
return request.cookies
return dict(cookies=request.cookies)
@app.route('/set-cookie/<name>/<value>')
@app.route('/cookies/set/<name>/<value>')
def set_cookie(name, value):
"""Sets a cookie and redirects to cookie list."""
response = app.make_response(redirect('/cookies'))
response.set_cookie(key=name, value=value)
r = app.make_response(redirect('/cookies'))
r.set_cookie(key=name, value=value)
return response
return r
@app.route('/basic-auth')