I am developing a simple application in python that provides a browser based interface using a local server. The structure is like this:
[Interface] <===> { [Server] <---> [Application] }
My application has a class function called, say, compute()
. On my browser interface, I have a button Compute. When the user clicks it, I want to run compute()
. My current approach is to send a GET
request like /path/compute
. The server identifies the request path and runs the function. Is this the correct way to go about it?
From this accepted answer:
GET is used for viewing something, without changing it, while POST is used for changing something
I am not using GET
here to view something immediately, but to send a command that changes the state of the application. Should I use POST
instead? Is there another method?