Add API to get complete url
See original GitHub issueAdd an API to get the url input in the browser with parameters and path
Problem
Streamlit does not provide an API for the above, right now.
Solution
st.get_url()
Which returns a string or some “url” object with the url of the app in the browser. This should include parameters.
We can just add a simple middleware or a simple hook into a Tornado handler and store this in a variable.
Additional context
https://discuss.streamlit.io/t/component-to-get-and-set-client-url/267/4
Issue Analytics
- State:
- Created 4 years ago
- Reactions:28
- Comments:13 (2 by maintainers)
Top Results From Across the Web
c# - How to get the full url of the current api NOT of the original ...
Is this code to build the full url, which is going wrong: var baseUrl = Request.RequestUri.GetLeftPart(UriPartial.Authority); var uri = Url.
Read more >4.2. API Basics: URL, Methods, Return Formats, Authentication
The API is accessed from the URL: http://www.domain.com/api/index.php. Specific methods are accessed by using the "method" query string parameter. Example: http ...
Read more >What is an API URL Path? API URL Meaning [Explained]
An API URL Path is an address that allows you to access an API and its various features. Using one is as simple...
Read more >URL API - MDN Web Docs - Mozilla
Chrome Edge
URL Full support. Chrome32. more. Toggle history Full support. Edge12. Togg...
URL() constructor Full support. Chrome19. Toggle history Full support. Edge12. footn...
createObjectURL Full...
Read more >URL Generation - The PHP Framework For Web Artisans
// Get the current URL without the query string... echo url()->current();. // ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Full steps
File location based on first step… /home/banjtheman/miniconda3/lib/python3.7/site-packages/tornado/routing.py
streamlit run test.py https://127.0.0.1:8501/?mypara1=99
Streamlit cloud has additional app-specific paths added to the domain name, like https://share.streamlit.io/benlindsay/streamlit-sharing-tabs/main/app.py. I think a link like this:
st.markdown("[link](/first-page)")
points to something like “https://share.streamlit.io/first-page” rather than “https://share.streamlit.io/benlindsay/streamlit-sharing-tabs/main/app.py/first-page”. I try to get around that in that app I linked to with an environment variable set to the full URL (see here ) but that is very brittle, and get_url() would be far superior.