To make an So browsers are very security conscious these days. They won’t allow you to do an AJAX call to get a file off your file system since a hacker could access any data on your system. So to exercise APIcall to access a file on disc we need to use a webserver. To spin up a webserver, navigate to the folder you would like to be able to access and run:
Code Block |
---|
python3 -m http.server --cgi 8080 |
This works under Mac OS X. Since it depends on your environment and having developer tools installed you might need to install the xcode command line tools.
The only thing that you will need to do is change the APIcall to use a “GET” method since this webserver has some limitations.
...