Skip to content
Advertisement

For restfulness, should I use one method for different get requests or seperate them

I am making a Blackjack rest service, and currently have 4 GET endpoints:

/hit
/stand
/double down
/surrender

I could also make just 1 POST/PATCH endpoint that uses a dto to send a move, or should I keep using these four uri’s?

Which option would be more restful/better?

Thanks in advance.

Advertisement

Answer

Use one endpoint. All of these actions/commands are working with the same set of data.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement