Access Localhost with network.request

Good day, How can I access my .json file from my localhost, I want to get and update it whenever I can from the app, but it appears that I can’t get my file from the localhost. I tried using PHP, but still it won’t let me access

my localhost URL is like this “http://some_ip_address._some._some”

What seems to be the problem, the html content is just a simple HELLO, and also the PHP is just a simple HELLO too, but the event.resposne always gives me, some long HTML code, and the PHP is just a 405 error.

Thanks in advance

Do you have a web server running on your local computer?  localhost (IP address 127.0.0.1) isn’t some arbitrary URL. It’s either going to be http://localhost/rest_of_url or http://127.0.0.1/rest_of_url.  You can’t use PHP unless you have setup a web server running locally on your computer and installed it to use PHP.

Can you provide more details about how you have a web server configured on your local computer?

Rob

Actually what I did, is just put the whole PHP project on the local server, and I just tried accessing it via it’s IP address.

Can you access the URL in a web browser (should check in Safari on a Mac or Internet Explorer, not Edge on Windows)?

Rob

Do you have a web server running on your local computer?  localhost (IP address 127.0.0.1) isn’t some arbitrary URL. It’s either going to be http://localhost/rest_of_url or http://127.0.0.1/rest_of_url.  You can’t use PHP unless you have setup a web server running locally on your computer and installed it to use PHP.

Can you provide more details about how you have a web server configured on your local computer?

Rob

Actually what I did, is just put the whole PHP project on the local server, and I just tried accessing it via it’s IP address.

Can you access the URL in a web browser (should check in Safari on a Mac or Internet Explorer, not Edge on Windows)?

Rob