vert.x - How to Transition from Path Parameters to Request Body in REST API Without Losing Functionality? - Stack Overflow

admin2025-04-17  3

In my software project (Java-Gradle-Vertx backend),

I have defined an endpoint as /a/ea/:eventId/*

In this, /a/* is for authenticating user,
a/ea/:eventId/* is for authorising the user for the given path parameter "eventId"
and then follows the endpoint for whatever POST/GET/DELETE we want to perform.

For example: /a/ea/:eventId/dd
Here, /dd stands for Delete Draw

All good so far.

But now, My manager has asked me to remove :eventId path parameter and include it in the request body instead citing the secutiry reasons of sending eventId through request payload.
So, my concern is If we have to send request body with /a/ea/* endpoint, it has to be a POST request. So, if the endpoint following /ea/:eventId let say /dd is a DELETE endpoint or in some case it can be GET endpoint where you cannot send request body. How do I tackle this?

In my software project (Java-Gradle-Vertx backend),

I have defined an endpoint as /a/ea/:eventId/*

In this, /a/* is for authenticating user,
a/ea/:eventId/* is for authorising the user for the given path parameter "eventId"
and then follows the endpoint for whatever POST/GET/DELETE we want to perform.

For example: /a/ea/:eventId/dd
Here, /dd stands for Delete Draw

All good so far.

But now, My manager has asked me to remove :eventId path parameter and include it in the request body instead citing the secutiry reasons of sending eventId through request payload.
So, my concern is If we have to send request body with /a/ea/* endpoint, it has to be a POST request. So, if the endpoint following /ea/:eventId let say /dd is a DELETE endpoint or in some case it can be GET endpoint where you cannot send request body. How do I tackle this?

Share edited Jan 31 at 9:02 VLAZ 29.2k9 gold badges63 silver badges84 bronze badges asked Jan 31 at 5:02 Utsav TaydeUtsav Tayde 12 bronze badges 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Bot Commented Jan 31 at 6:57
Add a comment  | 

1 Answer 1

Reset to default 0

Not just POST but all other methods can send a body with request. You just need to handle such requests carefully (not ignoring the body)

For more detailed explanation: https://stackoverflow.com/a/983458/7771506

转载请注明原文地址:http://anycun.com/QandA/1744880009a88926.html