Spaces:
Sleeping
Sleeping
Commit ·
6b8c4b6
1
Parent(s): ab6fe2f
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,17 +88,21 @@ def model_function(input_data):
|
|
| 88 |
|
| 89 |
# Streamlit UI code
|
| 90 |
def key_value_input(container, label, key, value, index):
|
| 91 |
-
common_headers = [
|
| 92 |
-
"Host", "User-Agent", "Accept", "Accept-Language",
|
| 93 |
-
"Accept-Encoding", "Connection", "Referer", "Cookie",
|
| 94 |
-
"Authorization", "Cache-Control", "Content-Type"
|
| 95 |
-
]
|
| 96 |
col1, col2 = container.columns(2)
|
| 97 |
|
| 98 |
-
#
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
|
|
|
| 102 |
return key_input, value_input
|
| 103 |
|
| 104 |
def dynamic_key_value_pairs(label):
|
|
|
|
| 88 |
|
| 89 |
# Streamlit UI code
|
| 90 |
def key_value_input(container, label, key, value, index):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
col1, col2 = container.columns(2)
|
| 92 |
|
| 93 |
+
# Use a simple text_input for keys in Request Body and Response Object
|
| 94 |
+
if label in ["Request Body", "Response Object"]:
|
| 95 |
+
key_input = col1.text_input(f"{label} Key {index}", key, key=f"{label}_key_{index}")
|
| 96 |
+
else:
|
| 97 |
+
# Existing logic for Request Header with common headers
|
| 98 |
+
common_headers = [
|
| 99 |
+
"Host", "User-Agent", "Accept", "Accept-Language",
|
| 100 |
+
"Accept-Encoding", "Connection", "Referer", "Cookie",
|
| 101 |
+
"Authorization", "Cache-Control", "Content-Type","API-Key"
|
| 102 |
+
]
|
| 103 |
+
key_input = col1.selectbox(f"{label} Key {index}", options=[''] + common_headers, index=common_headers.index(key) if key in common_headers else 0, key=f"{label}_key_{index}")
|
| 104 |
|
| 105 |
+
value_input = col2.text_input(f"{label} Value {index}", value, key=f"{label}_value_{index}")
|
| 106 |
return key_input, value_input
|
| 107 |
|
| 108 |
def dynamic_key_value_pairs(label):
|