I want to handle a GET request in my Flask REST API. The request will include multiple parameters, and you can expect this to be a typical GET request: https://localhost:5000/item/analysis=true&class=A&class=B
Thus, a GET request consists of:
- a Boolean variable called "analysis"
- a list called "class"
I want to accept this inside an add_resource() as follows:
add_resource(Item, '/item/<whatever-comes-here>')
I am clueless about how I would accept multiple parameters (one of them being a list) inside the add_resource(). How do I accept them in the add_resource() function and how do I unpack them inside the get() function?
I have spent time reverse engineering this, but I have not yet been successful. Am I doing something wrong?
(I understand that there might be a better way to send lists with a REST API GET request, so I'd appreciate any pointers regarding that!) Sincere thanks in advance!