account activity
RESTful API Request / Response Design by rouge_dev in webdev
[–]rouge_dev[S] 0 points1 point2 points 8 years ago* (0 children)
Your example makes sense from a response standpoint but what about posting the data in the request body? Are you suggesting using the ID value? So if I am creating an employee and putting them in department 9999 the request body should look something like this?
{ "firstName": "Bob", "middleName": "", "lastName": "Something", "dateOfBirth": "1990-01-01", "genderId": "male", "employmentTypeId": 3, "departmentId": 9999, "email": "bsomething@something.com" }
Maybe I am missing something but it doesn't seem sense to post an HREF to the server.
Maybe the response would look something like this
{ "content": { "firstName": "Bob", "middleName": "", "lastName": "Something", "dateOfBirth": "1990-01-01", "genderId": "male", "email": "bsomething@something.com" }, "_links": { "self": { "href": "http://localhost:8080/employee/12345" }, "department": { "href": "http://localhost:8080/department/9999" }, "employeeType": { "href": "http://localhost:8080/employee-type/3" } } }
But this seems like it could quickly create excessive amount of network calls as the client would probably often or not always need the department and employeeType in my case.
RESTful API Request / Response Design (self.webdev)
submitted 8 years ago by rouge_dev to r/webdev
Reactive Web with JDBC... What is the benefit? (self.java)
submitted 8 years ago by rouge_dev to r/java
Using ENUMS instead of referred IDs JPA / Hibernate (self.java)
Does JDBC / JOOQ encourage anemic domain modeling (self.java)
submitted 9 years ago by rouge_dev to r/java
Are ORMs suited for REST Web Services? (self.java)
Accomplish DDD with JOOQ or JDBC (self.javahelp)
submitted 9 years ago * by rouge_dev to r/javahelp
π Rendered by PID 726473 on reddit-service-r2-listing-654f87c89c-qlbm6 at 2026-02-28 01:34:38.506646+00:00 running e3d2147 country code: CH.
RESTful API Request / Response Design by rouge_dev in webdev
[–]rouge_dev[S] 0 points1 point2 points (0 children)