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
|
|
|
|
from io import BytesIO
|
|
|
|
|
|
|
|
|
2022-02-05 08:56:33 +03:00
|
|
|
@app.route("/bytes")
|
2020-08-27 10:07:46 +03:00
|
|
|
def bytes():
|
|
|
|
result = BytesIO()
|
2022-02-05 08:56:33 +03:00
|
|
|
result.write(b"\x01\x02\x03")
|
2020-08-27 10:07:46 +03:00
|
|
|
data = result.getvalue()
|
|
|
|
resp = make_response(data)
|
2022-02-05 08:56:33 +03:00
|
|
|
resp.content_type = "application/octet-stream"
|
2020-08-27 10:07:46 +03:00
|
|
|
return resp
|
2023-03-10 18:23:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
@app.route("/empty_bytes")
|
|
|
|
def empty_bytes():
|
|
|
|
result = BytesIO()
|
|
|
|
result.write(b"")
|
|
|
|
data = result.getvalue()
|
|
|
|
resp = make_response(data)
|
|
|
|
resp.content_type = "application/octet-stream"
|
|
|
|
return resp
|