Made a clone link example, it seems to work:
https://anvil.works/build#clone:WWHZUEM7BXMPC5NL=2ZJHXPWQDOGXLRSCE4CYB5IQ
import anvil.http
from hashlib import sha1
def is_pswd_pwnd(pswd="password"):
pswd = sha1(pswd.encode()).hexdigest().upper()
try:
response = anvil.http.request(url=f"https://api.pwnedpasswords.com/range/{pswd[:5]}",
method="GET",
headers= {
"user-agent": "Anvil",
})
except anvil.http.HttpError as err:
print(f"Error {err.status}")
#print(str(err.content))
response = response.get_bytes().decode('utf-8')
return pswd[5:] in response