Ask coding questions

← Back to all posts
Answered Make HTTP requests to Flask app
19ecal (230)

Ok, so I've got a basic Flask server running, nothing complicated, code:

from flask import Flask
app=Flask(__name__)
@app.route("/")
def hello():
  return "Hi there"
app.run(host="0.0.0.0", port=8000)

However, neither urllib nor requests can make HTTP requests to it, and I only get multiple long errors about tls and ssl
Does anybody have any idea what is happening and how to fix this?

Comments
hotnewtop
Coder100 (17091)
res=requests.get("http://FreshThunderousRepositiories.19ecal.repl.co")
print(res.text)
19ecal (230)

@Coder100 that still doesn't work

19ecal (230)

@Coder100 Actually it does I can't read there's an extra i that shouldn't be there in repositories, but i won't give u the check bc u already have enough cycles

Coder100 (17091)

You can't have the extra www, it's already a subdomain.

You should know that it is hosted on
http://FreshThunderousRepositiories.19ecal.repl.co

lol

19ecal (230)

Ok, having changed the code to request to http://www.FreshThunderousRepositiories.19ecal.repl.co instead of https:// , requests returns HTML for this page

Which is clearly not my basic server
And urllib returns 404