0

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?

Community
  • 1
  • 1
hazrmard
  • 3,397
  • 4
  • 22
  • 36

1 Answers1

0

Yes indeed, you must use a POST request here. You may want to read about REST APIs for more about the correct use of http verbs. The HTTP rfc is also a must-read...

bruno desthuilliers
  • 75,974
  • 6
  • 88
  • 118