0

As I attempt to run the Heroku CI tests, I find that I get a <404> request when I use the request to peek into my webserver's url:

resp = requests.post((url),
            json=dict(username = xxx, password = xxx),
       )

I've verified that all the url and inputted password and usernames are correct. The url is the predictable pattern from my app's settings. What else could be causing me to get a 404 error?

1 Answers1

0

Are you sure you need to submit user authentication as a JSON payload?

If not, try to use Basic Auth:

username = 'xxx'
password = 'xxx'
resp = requests.post(url, auth=(username, password))
dh762
  • 2,259
  • 4
  • 25
  • 44
  • Interestingly, as I changed this, I now get a status 503 error. This usually points to some sort of environment variable being off or the url endpoint being wrong. Any idea how I can isolate and pinpoint the error? – AnonymousPanda Sep 14 '20 at 19:01
  • what’s the full response? 503 means service unavailable. – dh762 Sep 14 '20 at 19:35
  • `resp.raise_for_status(); print(resp.text)` can help – dh762 Sep 15 '20 at 08:26
  • What shocks me most is that it passes locally with a local host url, but doesn't pass with the server_url provided by heroku. Any thoughts? Resp.text simply gives that this heroku gives me a no such app web link. – AnonymousPanda Sep 17 '20 at 22:38
  • in this case reach out to heroku for support – dh762 Sep 18 '20 at 08:12