I’m exploring the capabilities of Gradio apps hosted on Hugging Face Spaces. Specifically, I’m wondering if it’s possible for a Gradio app to make HTTP requests to an external server. For example, can the app send data to or retrieve data from an external API or service?
1 Like
I know that some URLs are blocked by Hugging Face to prevent abuse, but in principle it is possible. I’m doing it too. You can use requests or bs as they are.
If you mean http instead of https, I’m not sure… I wonder if it’s possible.
Yess, that’s exactly what I mean. Generally, you can’t use HTTP and HTTPS simultaneously, and since HuggingFace uses HTTPS, I was wondering if I would need to set up an SSL certificate for my server.
1 Like
I tried it now and it returned 200.
url = "http://*********" # not https
response = requests.get(url, timeout=30, verify=False)
Great, thank you
1 Like