title: FastAPI RedirectResponse custom headers
body: <p>Based off of <a href="https://stackoverflow.com/questions/62279710">my previous question</a>, I need to now add a header to the response.</p>
  
  <p>According to <a href="https://fastapi.tiangolo.com/advanced/response-headers/" rel="noreferrer">the documentation</a>, I can simply just add the headers and another attribute to the <code>RedirectResponse</code> object.</p>
  
  <p>When I test this, it doesn't seem to carry the header value over.</p>
  
  <p>According to <a href="https://stackoverflow.com/questions/7583461/redirect-to-page-and-send-custom-http-headers/41218304#41218304">this post</a>, it is impossible to set headers for a redirect request. So instead of a Redirect, maybe I should try something else?</p>
  
  <p>Any ideas?</p>
  
  <pre><code>from fastapi import FastAPI, Request
  from starlette.responses import RedirectResponse
  
  app = FastAPI()
  
  @app.get("/data/")
  async def api_data(request: Request):
      params = str(request.query_params)
      url = f'http://some.other.api/{params}'
      headers = {'Authorization': "some_long_key"}
      response = RedirectResponse(url=url, headers=headers)
      return response
  </code></pre>