Have a good ReSTful API

Define resources, design URL address

http://hostname:port/create-employee

http://hostname:port/get-employee?id=123

http://hostname:port/get-all-employees

http://hostname:port/update-employee

http://hostname:port/delete-employee

http://hostname:port/employee

http://hostname:port/employee/123

http://hostname:port/org/employee/123

http://hostname:port/org/department/234

http://hostname:port/org/v1/employee/123

http://hostname:port/v1/org/employee/123

ReST on HTTP

GET http://hostname:port/employee

GET http://hostname:port/employee?last-name=liu

GET http://hostname:port/employee/123

POST http://hostname:port/employee

PUT http://hostname:port/employee/123

DELETE http://hostname:port/employee/123

Let the ReSTful API talk

Implementation of ReSTful API

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store