2022-02-14 11:13:33 +03:00
|
|
|
from app import app
|
2020-08-27 10:07:46 +03:00
|
|
|
from flask import make_response, request
|
|
|
|
|
|
|
|
|
2022-02-05 08:56:33 +03:00
|
|
|
@app.route("/captures")
|
2020-08-27 10:07:46 +03:00
|
|
|
def captures():
|
|
|
|
resp = make_response()
|
2022-12-01 16:24:03 +03:00
|
|
|
resp.data = "Hello world!"
|
2022-02-05 08:56:33 +03:00
|
|
|
resp.headers["Header1"] = "value1"
|
|
|
|
resp.headers["Header2"] = "Hello Bob!"
|
2020-08-27 10:07:46 +03:00
|
|
|
return resp
|
|
|
|
|
|
|
|
|
2022-02-05 08:56:33 +03:00
|
|
|
@app.route("/captures-check")
|
2020-08-27 10:07:46 +03:00
|
|
|
def captures_check():
|
2022-02-05 08:56:33 +03:00
|
|
|
assert request.args.get("param1") == "value1"
|
|
|
|
assert request.args.get("param2") == "Bob"
|
|
|
|
return ""
|
2020-08-27 10:07:46 +03:00
|
|
|
|
|
|
|
|
2022-02-05 08:56:33 +03:00
|
|
|
@app.route("/captures-json")
|
2020-08-27 10:07:46 +03:00
|
|
|
def captures_json():
|
2022-02-05 08:56:33 +03:00
|
|
|
return '{ "a_null": null, "an_object": {"id": "123"}, "a_list": [1,2,3], "an_integer": 1, "a_float": 1.1, "a_bool": true, "a_string": "hello" }'
|