coltone24
coltone24
Mmarimo
Created by coltone24 on 1/13/2025 in #help-support
Accessing Middleware Values in a Marimo Cell
Yes, this is essentially what I did and works great for authing access to the app itself. However, what it doesn't solve is my use case where I want to be able to make api requests to our other api routes with something like requests.get() but need to attach the auth token to it and haven't found way to get that access token available within the cell itself.
@app.cell
def _():
import marimo as mo
import requests

headers = {
"Authorization": f"Bearer {access_token}"
}
metrics_response = requests.get("http://localhost:8080/api/metrics, headers)
return mo
@app.cell
def _():
import marimo as mo
import requests

headers = {
"Authorization": f"Bearer {access_token}"
}
metrics_response = requests.get("http://localhost:8080/api/metrics, headers)
return mo
11 replies