Ask coding questions

← Back to all posts
Ping sent by replit interfering with script
QuantumCodes (26)

I made this script that works when you change the method variable to POST.
method = "POST" (line 5)
but when i change it to get: method = "GET", then the ping sent by replit which gives a http 1.1 200 - response, then that interferes with the if/elif loop in the @app.route("/")...

  1. I want the GET method work
  2. I want to remove the and method == "GET" (line 11)characters from the elif loop.
Answered by Saml2020 (66) [earned 5 cycles]
View Answer
Saml2020 (66)

You don't need the method variable. Since the arg username is not required, you can see first if username is sent.

if 'username' in request.args:
  # Get Username arg
QuantumCodes (26)

Thank you so much!! It works!! @Saml2020