mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Merge branch 'delayed' of https://github.com/rmccue/httpbin
This commit is contained in:
@@ -272,6 +272,15 @@ def digest_auth(qop=None, user='user', passwd='passwd'):
|
||||
return jsonify(authenticated=True, user=user)
|
||||
|
||||
|
||||
@app.route('/delay/<int:delay>')
|
||||
def delay_response(delay):
|
||||
"""Returns a delayed response"""
|
||||
delay = min(delay, 30)
|
||||
time.sleep(delay)
|
||||
|
||||
return jsonify(get_dict(
|
||||
'url', 'args', 'form', 'data', 'origin', 'headers', 'files'))
|
||||
|
||||
@app.route('/base64/<value>')
|
||||
def decode_base64(value):
|
||||
"""Decodes base64url-encoded string"""
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<li><a href="/hidden-basic-auth/user/passwd"><code>/hidden-basic-auth/:user/:passwd</code></a> 404'd BasicAuth.</li>
|
||||
<li><a href="/digest-auth/auth/user/passwd"><code>/digest-auth/:qop/:user/:passwd</code></a> Challenges HTTP Digest Auth.</li>
|
||||
<li><a href="/stream/100"><code>/stream/:n</code></a> Streams <em>n</em> lines.</li>
|
||||
<li><a href="/delay/10"><code>/delay/:n</code></a> Delays responding for <em>n</em> seconds.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user