Skip to content

How to set the data HTTP request headers #403

Answered by vincentsarago
pepjo asked this question in Q&A
Discussion options

You must be logged in to vote

👋 @pepjo

To modify the headers use for the STAC request you'll need to set fetch_options={"headers": {YOUR HEADERS VALUE}} rio-tiler

Sadly this has to be pass at reader init

with self.reader(src_path, **self.reader_options) as src_dst:

but we don't have a dynamic way of populating the reader options 🙁. I fear you'll have to re-write the routes where you want to use this.

@self.router.get(
    "/info",
    response_model=Info,
    response_model_exclude_none=True,
    response_class=JSONResponse,
    responses={200: {"description": "Return dataset's basic info."}},
)
def info(
    src_path=Depends(self.p…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@pepjo
Comment options

@vincentsarago
Comment options

@vincentsarago
Comment options

Answer selected by pepjo
Comment options

You must be logged in to vote
3 replies
@pepjo
Comment options

@vincentsarago
Comment options

@pepjo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants