I have a question regarding sending data via a CURL through POST and sending data through the URL. More generally, I have a flask route
@app.route('/create', methods=['POST'])
def clone:
...
How can I also send data using a URL? I want to do something like this:
<my-server>:port/create/arg1/arg2/arg3
I just figured out you can do something like
@app.route('/create', methods=['POST'])
@app.route('/create/<op>/<source>/<target>', methods=['GET'])
def clone(op = None, source = None, target = None):
...
Which will work. Is this a good approach?
To access the actual query string (everything after the
?
) use:To access known query parameters:
If you're looking to use variables sent like
/arg1/arg2/arg3
use: