score:1

Accepted answer

It seems in my code some headers and part of body is missing so for a clean redirect I used this code:

response = requests.request(
    method=request.method,
    url='http://127.0.0.1:7779',
    headers={key: value for (key, value) in request.headers},
    data=request.get_data(),
    cookies=request.cookies,
    allow_redirects=False)
headers = [(name, value) for (name, value) in response.raw.headers.items()]
return Response(response.content, response.status_code, headers)

And now output is fine.


Related Query

More Query from same tag