Hi I am trying to replace php-java-bridge
with restful API, in older application EJBs were accessed by PHP using php-java-bridge
Using this bridging mechanism I was able to send complex Objects from PHP
to Java
.
Now as we have replaced the bridge with Restful API now instead of object we have to send each individual param.
Let say I have a User
class consist of id
, name
and favouriteLinks
favrouteLinks
is an array of Type Link
consist of title
and url
.
class User {
Integer id;
String name;
Link[] favouriteLinks;
}
class Link {
String title;
String url;
}
Let say API is trying to save a user with multiple favourite links detail. Now as you have noticed that this is a nested/hierarchical information that need to be passed. What is the correct way to achieve this?
api.something.com/1/user?id=101&name=Jon&favourite????
What if I have an array of users that have an array of favourite links????
Please share your expert thoughts.