Local webserver and HA

I’m running a local webserver on my PI that is also running HomeAssistant. I am trying to access the HA API from the webserver by calling the localhost:8123 for my url in the JQuery request, however I keep getting connection refused error on my website.

Anyone know how to access HA from the webserver that is all locally on the PI?

Thanks

do you have your password configured in HA?

No, right now I have my API password disabled for testing.

The API accepts and returns only JSON encoded objects. All API calls have to be accompanied by the header X-HA-Access: YOUR_PASSWORD (YOUR_PASSWORD as specified in your configuration.yaml file in the http: section).

So even if I don’t have a PW then I still need all that header information?

That’s what it sounds like.

You can use the trusted_networks piece on http: to bypass passwords on your main desktop during testing.

Alright, I’ll try that out when I get home. Thanks for the info!