If the edge service and edge node are in the Running status, the edge service has been successfully deployed on the edge node.
You can use either of the following methods to send an inference request to the edge service deployed on the edge node in a network that can access the edge node:
Select form-data. Set KEY to the input parameter of the model, for example, images. Set VALUE to an image to be inferred (only one image can be inferred).
Select raw and then select JSON(application/json). Enter the request body in the text box below. An example request body is as follows:
{ "meta": { "uuid": "10eb0091-887f-4839-9929-cbc884f1e20e" }, "data": { "req_data": [ { "sepal_length": 3, "sepal_width": 1, "petal_length": 2.2, "petal_width": 4 } ] } }
meta can carry uuid. When the inference result is returned, the UUID is returned to trace the request. If you do not need this function, leave meta blank. data contains the req_data array. You can pass one or more pieces of request data. The parameters of each piece of data are determined by the model, such as sepal_length and sepal_width in this example.
curl -F 'images=@Image path'-X POST Service address of the edge node
curl -F 'images=@/home/data/cat.jpg' -X POST http://192.168.0.158:1032
curl -d '{ "meta": { "uuid": "10eb0091-887f-4839-9929-cbc884f1e20e" }, "data": { "req_data": [ { "sepal_length": 3, "sepal_width": 1, "petal_length": 2.2, "petal_width": 4 } ] } } '-X POST <Service address of the edge node>
The following is an example of the cURL command for inference with text input:
curl -d '{ "meta": { "uuid": "10eb0091-887f-4839-9929-cbc884f1e20e" }, "data": { "req_data": [ { "sepal_length": 3, "sepal_width": 1, "petal_length": 2.2, "petal_width": 4 } ] } }' -X POST http://192.168.0.158:1033