I need use HTTP authorization with header Authorization: Token. My code:
@router.get('/versions',tags=["Credentials"],responses={
200: {
"model": List[models.versions_info],
"description": "Return has code",
"headers": {"Authorization": {"description":"Token party","type":"string"}}
}})
async def list_versions(token: Union[str, None] = Header(description="Token party",alias="Authorization: Token",default=None)):
out=[{"version": "2.1.1","url": "https://www.server.com/ocpi/2.1.1/"},{"version": "2.2","url": "https://www.server.com/ocpi/2.2/"}]
return Response(status_code=200,content=json.dumps(out), media_type="application/json", headers={"Authorization: Token "+config.globals["mytoken"]})
However, when using I get an error:
Can you tell me where I'm wrong?
Update: if i modify code to:
async def list_versions(token: Union[str, None] = Header(alias="Authorization",default=None))
the header is not sent at all:

