Best Practice for Passing Parameters: Frontend vs Backend?

Hi everyone!

I'm working on a feature where I need to format data based on the user's language. I'm trying to determine the best way to pass this information to the backend for querying the data. There are two approaches I’m considering:

  1. Send the user's language as a parameter from the frontend when the user clicks a button (as this parameter was already pulled to the front when user launched the app)

  2. In the backend, make an additional request to GET the user's language and then use it as a parameter in the query

Are there any best practices or considerations (e.g., performance, security, maintainability) when choosing between these two methods? I'd appreciate any insights or experiences!

Thanks in advance!

2 replies