Reputation: 13400
I am developing a web app with Flask.
I have two routes:
@app.route("/<random_id>", methods = ['GET'])
def random_url(random_id):
return "GET"
@app.route("/<random_id>", methods = ['POST'])
def random_url_post(random_id):
return "POST"
When I access it with GET, I received "GET" but when I tried with POST request, it failed:
root@ubuntu:~# curl http://localhost:1337/a
GET
root@ubuntu:~# curl -xPOST http://localhost:1337/a
curl: (5) Could not resolve proxy: POST
curl: (5) Could not resolve proxy: POST
What can be a reason for that?
Upvotes: 0
Views: 40