Is this the “correct” way of sending data from client to server

server

I have a Jetty web server running which accepts POST submissions from clients(currently just a java program that simulates what I want to be an Android device) The client program sends data via POST and the server process each request and stores them in a sql db.

Is this the correct way of communicating with the server? The client just periodically sends data to the server using POST. It does work but are there better ways to send data?

The client dont interact with any Form, the device just sends data to the server, this data could be anything.

Best Answer

The purpose of your POST is to send data to the server. Is it fulfilling that function in a reasonably graceful way?

Nowadays, data is "conventionally" sent between machines on the internet using REST, an architectural style, and JSON, a data exchange format. But a few years ago we were using things like SOAP and XML. Tomorrow, we will be using QUBIT architecture, and REST will seem like old hat.

Do you need REST? Not unless you need the benefits it provides. REST is mostly about defining resources and having machines apply useful verbs to those resources. You can read about that here: http://www.looah.com/source/view/2284

Related Topic