Need to pass query params to endpoint using ProxyGetRequest #1485
-
I need to pass a query params so I can do localhost:5050/account_balance?contract_address=0x123 but dont know how to define a placeholder for this params when creating the endpoint, is this posible?:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @fabrobles92 It doesn't work because https://github.com/paritytech/jsonrpsee/blob/master/server/src/middleware/http/proxy_get_request.rs#L135 requires the path exactly match and it doesn't extract the query params from the URL and passes it on to the rpc call. Thus, either open a PR to add support for that in ProxyGetRequest or just write your own middleware for that (you can use https://github.com/paritytech/jsonrpsee/blob/master/server/src/middleware/http/proxy_get_request.rs as template) for that |
Beta Was this translation helpful? Give feedback.
Hey @fabrobles92
It doesn't work because https://github.com/paritytech/jsonrpsee/blob/master/server/src/middleware/http/proxy_get_request.rs#L135 requires the path exactly match and it doesn't extract the query params from the URL and passes it on to the rpc call.
Thus, either open a PR to add support for that in ProxyGetRequest or just write your own middleware for that (you can use https://github.com/paritytech/jsonrpsee/blob/master/server/src/middleware/http/proxy_get_request.rs as template) for that