しようとしたときに404を得ることがこれは私の関数がどのように見えるかです:フラスコJWT - アクセス/認証
# authenticate a user
def authenticate(username, password):
userAuth = username_mapping.get(username, None)
if userAuth and userAuth.password == password:
return userAuth
# identify user from a token
def identity(payload):
user_id = payload['identity']
return userid_mapping.get(user_id, None)
しかし、私はそれにいくつかのJSONデータを投稿しようとすると、それは私に次のエラーを与える:
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
何が問題なのですか?あなたのファイル内
@app.route('/auth', methods=['POST'])
:
あなたは '@ app.route'をどのように定義しましたか、あなたは投稿を行うためにどのURLを使用していますか? –
私は 'get'メソッドの上に' @jwt_required() 'を置き、' http:// 127.0.0.1/auth'のURLを使用します。 – gambit2017