0

following problem:

I have a flask http server set up that is supposed to only receive POST requests.

Server code:

import flask


app = flask.Flask(__name__)

@app.route("/")
def onRequest(methods=['POST']):
    return flask.request.method

When I open the Adress in my browser it says: "GET". And when I send a POST to the adress it says: "HTTP 405 (METHOD NOT ALLOWED)" (From the service that posts to the adress).

BillPlayz
  • 3
  • 1
  • `methods=['POST']` says that this handler is only for handling POST (e.g., form post) events. Typing a URL into a browser generates a GET request. – Dave W. Smith Mar 15 '22 at 03:11

0 Answers0