How can I call with Postman a RESTful API deployed with Gradio?
I’m following the basic Gradio interface from the Gradio documentation:import gradio as gr

def greet(name):
    return "Hello " + name + "!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")

demo.launch()The interface is:I believe this deploys a RESTful API, since it says “Use via API” in the footer of the interface:How can I call that RESTful API with Postman?
2023-10-23T04:39:35Z
Update: using the endpointhttp://localhost:7861/api/predictseems to work better, but I am still trying to figure out what the name of the key is:Any idea?
2023-10-23T04:57:48Z
hi@Franck-Dernoncourt, this Curl request works for me, content type has to beContent-Type: application/json'hello_world - a Hugging Face Space by gradiocurl --location 'https://gradio-hello-world.hf.space/run/predict' \
--header 'Content-Type: application/json' \
--data '{
    "data": [
        "test data"
    ]
}'
2023-10-23T04:59:57Z
Thanks@radames, that worked. I didn’t have to setenable_queue=Falsethough. Following your curl queryy, to do the same in Postman, set the content type toapplication/jsonand use the same payload as in your answer:{"data": ["test"]}image3840×2060 301 KB
2023-10-23T05:03:47Z
yes, you’re right no need to disable queue, since the api is enabled. So the REST endpoint is also enabled, I did miss you’re not posting the rightContent-TypeI’m glad it’s working!