From cf6888255218196fd712f566f8631b13c51a5e65 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sat, 26 Aug 2017 14:26:49 -0400 Subject: [PATCH] uuid4 --- httpbin/core.py | 7 +++++++ httpbin/templates/httpbin.1.html | 1 + 2 files changed, 8 insertions(+) diff --git a/httpbin/core.py b/httpbin/core.py index 5c1caed..3bcc54f 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -159,6 +159,13 @@ def view_origin(): return jsonify(origin=request.headers.get('X-Forwarded-For', request.remote_addr)) +@app.route('/uuid') +def view_uuid(): + """Returns a UUID.""" + + return jsonify(uuid=str(uuid.uuid4())) + + @app.route('/headers') def view_headers(): """Returns HTTP HEADERS.""" diff --git a/httpbin/templates/httpbin.1.html b/httpbin/templates/httpbin.1.html index 01fe9d1..ea07ce6 100644 --- a/httpbin/templates/httpbin.1.html +++ b/httpbin/templates/httpbin.1.html @@ -13,6 +13,7 @@