Created
June 18, 2013 14:50
-
-
Save ThiefMaster/5806003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> 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