Answer the question
In order to leave comments, you need to log in
Spring How to create complex Rest reference?
Good afternoon everyone. Maybe someone can tell me where to look.
There is a REST service that makes queries to the database using a link.
At the moment, about 6 variables need to be passed to this link.
At the same time, depending on the request, some variables may not be transmitted, for example, if the request is transmitted without a start date.
Link example.
service/{startTime}/{endTime}/{startResult}/{onPage}/{status}
Answer the question
In order to leave comments, you need to log in
Why do you want to pass data to PathVariable? Especially considering that pathvariable is required. It turns out that you will need to iterate over all possible combinations of pathvariable.
As for me, it's better to just use one url and process not pathvariable in the controller, but requestParam (required = false). And accordingly, pass everything you need in the body POST.
If I understood your task correctly... Only, if necessary, it is probably
worthwhile
to implement obtaining a token for authorization and pass a bearer token in the header
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question