Does FastAPI provide some kind of way of converting a set of args and kwargs into inputs to requests? That is, converting them into the params and json of requests.post and requests.get etc.
I know FastAPI does some clever conversions here, and I’d like to replicate it. For instance, I know that if there is a Pydantic model in the arguments then it automatically means that you put it into json
I basically want a function prepare_requests_args(kwargs) that gives me two dictionaries corresponding to params and json respectively
# Check that the argument sets of RemoteController.__init__ and create_remote_controller matchargset1 =set(p.name for p in inspect.signature(RemoteController.__init__).parameters.values())argset1.remove('self')argset2 =set(p.name for p in inspect.signature(create_remote_controller).parameters.values())argset2.remove('base_controller_cls')assert argset1 == argset2