cli icon indicating copy to clipboard operation
cli copied to clipboard

Not following 304 redirect with POST

Open struckoff opened this issue 6 years ago • 2 comments
trafficstars

If I do this http --all -F POST "http://127.0.0.1:37375 @data.csv I get:

HTTP/1.1 304 Not Modified
Connection: close
Date: Wed, 14 Aug 2019 13:43:09 GMT
Location: http://127.0.0.1:27375/

Server (:37375) logs says that redirect sent, but nothing appeared on :27375

If I do this using curl -L - works as expected, data sends to :27375

struckoff avatar Aug 14 '19 13:08 struckoff

Could you please give more info about the environment you run on? windows? I can't reproduce this issue on macos.

I ran this server:

from flask import Flask, redirect

app = Flask(__name__)


@app.route('/', methods=['POST'])
def hello():
    return redirect("http://www.example.com", code=304)

locally, and executing http --all -F POST http://127.0.0.1:5000/ hello=World gives me:

HTTP/1.0 304 NOT MODIFIED Date: Tue, 10 Sep 2019 07:39:40 GMT Location: http://www.example.com Server: Werkzeug/0.15.5 Python/3.7.4

khadrawy avatar Sep 10 '19 07:09 khadrawy

I also couldn't reproduce the problem, @struckoff would you mind sharing a reproducer URL?

isidentical avatar Dec 28 '21 12:12 isidentical