# Get the Request headers using Blocks

**URL:** <https://discuss.huggingface.co/t/get-the-request-headers-using-blocks/52830>\
**Category:** 🔒 Gradio\
**Created:** [August 30, 2023, 3:36pm UTC](https://discuss.huggingface.co/t/get-the-request-headers-using-blocks/52830 "2023-08-30T15:36:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![uimarer](https://avatars.discourse-cdn.com/v4/letter/u/59ef9b/32.png) [@uimarer](https://discuss.huggingface.co/u/uimarer)\
**Post date:** [August 30, 2023, 3:36pm UTC](https://discuss.huggingface.co/t/get-the-request-headers-using-blocks/52830/1 "2023-08-30T15:36:58Z")

</div>

Hi,

I am trying to do a chatbot and get the request header to manage my chat engine on a per user basis. I see example showing how to get that from the Interface, but it seems it is always part of a callback function.

How would you do it with this block:

```auto
with gr.Blocks() as demo:
    chatbot = gr.Chatbot()
    msg = gr.Textbox()
    clear = gr.ClearButton([msg, chatbot])

    def respond(message, chat_history):
        bot_message = random.choice(["How are you?", "I love you", "I'm very hungry"])
        chat_history.append((message, bot_message))
        time.sleep(2)
        return "", chat_history

    msg.submit(respond, [msg, chatbot], [msg, chatbot])

app = gr.mount_gradio_app(app, demo, path=CUSTOM_PATH)

```

Thanks

---

<div class="post-metadata">

**Author:** ![roydebox](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@roydebox](https://discuss.huggingface.co/u/roydebox)\
**Post date:** [October 17, 2023, 9:16am UTC](https://discuss.huggingface.co/t/get-the-request-headers-using-blocks/52830/2 "2023-10-17T09:16:05Z")

</div>

Any update on this issue? I run into the same issue and can’t find any clue from docs and source code.
