Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster
Created June 18, 2013 14:50
Show Gist options
  • Save ThiefMaster/5806003 to your computer and use it in GitHub Desktop.
Save ThiefMaster/5806003 to your computer and use it in GitHub Desktop.
from flask import Flask
app = Flask(__name__)
@app.route('/foo/<path:bla>/')
def foo_path(bla):
print 'foo_path', bla
@app.route('/foo/<xyz>/foobar')
def foobar(xyz):
print 'foobar', xyz
app.run()
>> http post http://127.0.0.1:5000/foo/123/foobar
HTTP/1.0 301 MOVED PERMANENTLY
Content-Length: 281
Content-Type: text/html; charset=utf-8
Date: Tue, 18 Jun 2013 14:49:25 GMT
Location: http://127.0.0.1:5000/foo/123/foobar/
Server: Werkzeug/0.9.1 Python/2.7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment