Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
def echo(text, request: gr.Request):
|
| 3 |
+
if request:
|
| 4 |
+
print("Request headers dictionary:", request.headers)
|
| 5 |
+
print("IP address:", request.client.host)
|
| 6 |
+
print("Query parameters:", dict(request.query_params))
|
| 7 |
+
return request.headers, request.client.host
|
| 8 |
+
io = gr.Interface(echo, "textbox", ["json", "textbox"]).launch(debug=True)
|