I have a generator function that generates CSVs and as per Flask's documentation I pass that function inside the Response object.
app.route("/stream")
...
def generate():
        yield ",".join(result.keys()) #Header
        for row in result:
            yield ",".join(["" if v is None else str(v) for v in row])
return current_app.response_class(stream_with_context(generate()))
When I go to read the response inside my Request I get response back as one giant string as opposed to getting line by line so it can be written to a csvwriter
s = requests.Session()
with s.get(
    urllib.parse.urljoin(str(current_app.config["API_HOST_NAME"]), str("/stream")),
    headers=None,
    stream=True,
) as resp:
    for line in resp.iter_lines():
        if line:
            print(line) #All the rows are concatenated in one big giant String
            cw.writerow(str(line, "utf-8").split(","))
 
     
    