Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Need some help with Deta Micros #274

Answered by jnsougata
SlumberDemon asked this question in Help
Discussion options

You must be logged in to vote

Use requesr.headers.get to access the API KEY sent with request header ( example: {'X-API-KEY': YOUR_API_KEY} )
EXAMPLE:

from fastapi import FastAPI, Request

@app.get("/")
async def root(request: Request):
    api_key = request.headers.get('X-API-KEY') 
   # do stuff with api_key here

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@SlumberDemon
Comment options

Comment options

You must be logged in to vote
1 reply
@SlumberDemon
Comment options

Answer selected by SlumberDemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants