Spaces:
Build error
Build error
Anil commited on
Commit ·
5bc60f8
1
Parent(s): f3db210
lambda to API
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import requests # For making the API call to the
|
| 3 |
import re # For regular expression pattern matching
|
| 4 |
|
| 5 |
# Regular expression for domain validation
|
|
@@ -31,17 +31,17 @@ def process_lead_search(domain, password):
|
|
| 31 |
if not password:
|
| 32 |
return "Error: The password cannot be empty."
|
| 33 |
|
| 34 |
-
|
| 35 |
|
| 36 |
-
# Prepare the payload to send; ensure this matches what your
|
| 37 |
payload = {
|
| 38 |
"domain": domain,
|
| 39 |
"password": password
|
| 40 |
}
|
| 41 |
|
| 42 |
-
# Make the POST request to the
|
| 43 |
try:
|
| 44 |
-
response = requests.post(
|
| 45 |
response_data = response.json()
|
| 46 |
if response.status_code == 200:
|
| 47 |
return response_data.get('message', 'Success, but no message returned.')
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import requests # For making the API call to the API function
|
| 3 |
import re # For regular expression pattern matching
|
| 4 |
|
| 5 |
# Regular expression for domain validation
|
|
|
|
| 31 |
if not password:
|
| 32 |
return "Error: The password cannot be empty."
|
| 33 |
|
| 34 |
+
api_endpoint = 'https://beta.nextbee.com/lib/scripts/replication_logs/index.php?db=jtaxbeta'
|
| 35 |
|
| 36 |
+
# Prepare the payload to send; ensure this matches what your API function expects
|
| 37 |
payload = {
|
| 38 |
"domain": domain,
|
| 39 |
"password": password
|
| 40 |
}
|
| 41 |
|
| 42 |
+
# Make the POST request to the API function
|
| 43 |
try:
|
| 44 |
+
response = requests.post(api_endpoint, json=payload)
|
| 45 |
response_data = response.json()
|
| 46 |
if response.status_code == 200:
|
| 47 |
return response_data.get('message', 'Success, but no message returned.')
|