My REST API knowledge is not up to date. When we apply filters or sorting when implementing a REST API, I know that we used to put ?
and &
to the endpoint like below:
/actors?attr={attr_value} Example: /actors?name=”Bob”
Filters out all actors that don’t have “Bob” in their name (Should allow for similar filtering for any other attribute)
However, when I see Flask examples, I've never seen someone adding those parameters to the endpoint like
@app.route("/api/v1/actors?gender=<gender>", methods = ['GET'])
def get_player(gender):
....
What is the right way of applying filters or sorting when implementing a REST API with Flask?