Closed havok2063 closed 2 months ago
A follow-up question, does Solara provide access to the incoming request?
I finally found answer to my first question. For posterity, you can access get request query parameters through the router.search
attribute. With a url like http://localhost/?a=b&hello=there
, router.search
returns a string of a=b&hello=there
that can be parsed.
def Page():
router = solara.use_router()
params = router.search
print(params)
I couldn't find any of accessing the complete request through the solara.server.fastapi.app
, so that is still unknown. This would be useful for accessing request headers and cookies to extract out authentication info.
Maybe this helps: https://solara.dev/api/cookies_headers
Yeah I believe this should work. I haven't had a chance yet to test it out but hopefully will soon.
Hi Florian,
thank you for beating me to this :)
I was looking for this issue, because I wanted to reply to Brian that this is released in version 1.27.
Let me know if you run into issues Brian, and I think we can close this issue.
Regards,
Maarten
Does Solara accept query parameters in the url? I seem to recall that it does but I can't find anything referencing it in the documentation or examples of how to retrieve parameters from something like
localhost:8765?param=a¶m=b
. Also related to #457