How to create a REST web service to write a row to a data table. Use the following script:
The table is called Client - the data that will be inserted into the line will be the name, address, phone number, email address.
I think it is impossible to fully describe all this in Java or C #, and I would never have expected it, but here are the questions that pop up to my head when I prepare the coding:
- What will the URI look like (for example, if you use this URL - http://www.example.com/ )?
- What information will get into the HTTP shell?
- Can I use POST when writing to the database this way?
- Am I using a resource to store published data from a client? Is it even necessary if the data is still written to the database?
- When the data that needs to be written to db is received by the server - how can I physically insert it into the database - do I call any method on the server to actually write the data (in Java)? - this does not seem to match the true REST architecture - avoids RPC calls.
- Do I even have to worry about writing to the database - should I store my data as a resource?
As you can see, I need to clear a few questions in my head. Any help is greatly appreciated.
Vidar source share