GET method replaced by POST method
This commit is contained in:
parent
e4034813a2
commit
c8b67c5c50
2 changed files with 5 additions and 5 deletions
6
app.py
6
app.py
|
@ -18,7 +18,7 @@ create_admin_if_dont_exists(etcd_client)
|
|||
|
||||
class Verify(Resource):
|
||||
@staticmethod
|
||||
def get():
|
||||
def post():
|
||||
data = request.json
|
||||
if data:
|
||||
schema = OTPSchema(data)
|
||||
|
@ -74,7 +74,7 @@ class Delete(Resource):
|
|||
|
||||
class List(Resource):
|
||||
@staticmethod
|
||||
def get():
|
||||
def post():
|
||||
data = request.json
|
||||
|
||||
schema = ListAccountSchema(data)
|
||||
|
@ -100,4 +100,4 @@ api.add_resource(Delete, "/delete")
|
|||
api.add_resource(List, "/list")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True, port=decouple.config("PORT", int))
|
||||
app.run(debug=True, host="::", port=decouple.config("PORT", int))
|
||||
|
|
|
@ -29,7 +29,7 @@ if action == "list":
|
|||
"admin_realm": args.admin_realm,
|
||||
"admin_token": pyotp.TOTP(args.admin_seed).now()
|
||||
}
|
||||
r = requests.get("http://localhost:{}/list".format(decouple.config('PORT')),
|
||||
r = requests.post("http://localhost:{}/list".format(decouple.config('PORT')),
|
||||
json=data)
|
||||
print(r.content.decode("utf-8"))
|
||||
|
||||
|
@ -61,7 +61,7 @@ elif action == "verify":
|
|||
"auth_realm": args.auth_realm,
|
||||
"auth_token": pyotp.TOTP(args.auth_seed).now()
|
||||
}
|
||||
r = requests.get("http://localhost:{}/verify".format(decouple.config('PORT')),
|
||||
r = requests.post("http://localhost:{}/verify".format(decouple.config('PORT')),
|
||||
json=data)
|
||||
print(r.content.decode("utf-8"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue