Hello everyone.
I'm in the process of creating proxies for a back-end server. And I'm trying to avoid complex pathing And I have three questions:
Let's suppose that the api has three entities: University, students and teachers. In students there are services for junior students only and services for senior students only and common services between the two.
I'm trying to follow RFC3986 design and this best practices:
https://blog.restcase.com/5-basic-rest-api-design-guidelines/
Thank you very much.
Solved! Go to Solution.
Is it ok to use query parameters to route to a certain back-end service?
>>>> There is no rule saying it's not OK to use query parameters. It really is up to you.
But, if you go by the book (read:REST best practices) then using query parameter in your case is not recommended. Instead, use different end points:
/students/ | << common services |
/students/seniorstudents/ | << services only for seniors |
/students/juniorstudents/ | << services only for juniors |
Is it ok for the route to a backend service be different that the route of Apigee.
>>>> Yes.
If you want to go down the query parameters route, or to rewrite the URL to target endpoint, in article [1], Siddharth provided a pretty neat sample code to achieve what you want.
[1] https://community.apigee.com/questions/59426/proxy-with-query-parameter-calling-target-with-pat.html
Is it ok to use query parameters to route to a certain back-end service?
>>>> There is no rule saying it's not OK to use query parameters. It really is up to you.
But, if you go by the book (read:REST best practices) then using query parameter in your case is not recommended. Instead, use different end points:
/students/ | << common services |
/students/seniorstudents/ | << services only for seniors |
/students/juniorstudents/ | << services only for juniors |
Is it ok for the route to a backend service be different that the route of Apigee.
>>>> Yes.
If you want to go down the query parameters route, or to rewrite the URL to target endpoint, in article [1], Siddharth provided a pretty neat sample code to achieve what you want.
[1] https://community.apigee.com/questions/59426/proxy-with-query-parameter-calling-target-with-pat.html
Thanks a lot Brendan.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |